adding strip slashes to the autocomplete so that fields can be searched with sql...
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 Oct 2018 18:48:18 +0000 (14:48 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 Oct 2018 18:48:18 +0000 (14:48 -0400)
models/admin/ajax/glmTextSearch.php

index f672873..d9fa913 100644 (file)
@@ -78,6 +78,7 @@ class GlmMembersAdmin_ajax_glmTextSearch
             $clause         = filter_var($_REQUEST['where'], FILTER_SANITIZE_STRING);
             $searchQuery    = filter_var($_REQUEST['query'], FILTER_SANITIZE_STRING);
             $fields         = $_REQUEST['fields'];
+            $fields         = stripslashes($fields);
             $table          = filter_var($_REQUEST['table'], FILTER_SANITIZE_STRING);
             $sql            = "SELECT $fields FROM $table where $clause like '%$searchQuery%'";
             $entities       = $wpdb->get_results($sql); 
@@ -92,7 +93,6 @@ class GlmMembersAdmin_ajax_glmTextSearch
         }
         
         $return = array(
-            "test"  => $sql,
             'searchData'    => $searchData        // Where our events list will go
         );