Hidden submit field, fix for the sql statement
authorLaury GvR <laury@gaslightmedia.com>
Thu, 25 Feb 2016 18:58:02 +0000 (13:58 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 25 Feb 2016 18:58:02 +0000 (13:58 -0500)
models/admin/member/social.php
setup/adminTabs.php
views/admin/member/social.html

index eb712d7..ef9be9f 100644 (file)
@@ -183,7 +183,7 @@ class GlmMembersAdmin_member_social extends GlmDataSocial
         
         // If there's an action option
         if (isset($_REQUEST['option'])) {
-            $option = trim($_REQUEST['option']);
+            $option = trim(filter_var($_REQUEST['option'],FILTER_SANITIZE_STRING));
         }
         
         $socialData = $this->editEntry($memberID);
@@ -242,7 +242,7 @@ class GlmMembersAdmin_member_social extends GlmDataSocial
                 // Also update all member info records with any possible name change
                 $sql = "
                     UPDATE ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."socialURL
-                       SET facebook_url = www.testval.com
+                       SET facebook_url = 'www.testval.com'
                      WHERE member_id = 1
                 ;";
 //                $sql = "
index dd5514e..cfa1ca1 100644 (file)
@@ -58,4 +58,4 @@ add_filter('glm-member-db-add-tab-for-member',
         $addOnTabs = array_merge($addOnTabs, $newTabs);
         return $addOnTabs;
     }
-);
\ No newline at end of file
+);
index 27ee18e..df3628d 100644 (file)
@@ -9,7 +9,8 @@
         <p>{$displayData}</p>
         <a href="{$thisURL}?page={$thisPage}&glm_action=more">Click me to see more!</a>
         <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
-            <input type="submit" class="button glm-button submit" value="{if $memberInfoID && $memberInfo}Update member information{else}Add new member information{/if}">
+            <input type="submit" class="button glm-button submit" value="submit">
+            <input type="hidden" name="option" value="submit">
             <div class="button glm-button right">Update</div>
             <table class="glm-admin-table">
             {foreach from=$socialArray key=k item=socialItem}