Data Abstract now looks in $_REQUEST for all input data
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 4 Jan 2019 21:07:20 +0000 (16:07 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 11 Jan 2019 19:25:51 +0000 (14:25 -0500)
lib/GlmDataAbstract/DataAbstract.php

index 20861ff..ded4f3b 100755 (executable)
@@ -1033,7 +1033,7 @@ abstract class GlmDataAbstract
         } else {
 
             // Sanitize currently selected value
-            $in = filter_input(INPUT_POST, $as, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
+            $in = filter_var($_REQUEST[$as], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
 
             // Is it one of the available values
             if (isset($f['required']) && $f['required'] && trim($in) == '') {
@@ -1242,7 +1242,7 @@ $forEdit = true;
 
         $this->inputFieldStatus = true;
 
-        // If a filter has been specified, use that with the php filter_input() function.
+        // If a filter has been specified, use that with the php filter_var() function.
         $filter = FILTER_SANITIZE_STRING;
         if (isset($f['filter'])) {
             if (!is_numeric($f['filter'])) {
@@ -1259,14 +1259,14 @@ $forEdit = true;
                 $filter_options = $f['filter_options'];
             }
 
-            $in = filter_input(INPUT_POST, $as, $filter, $filter_options);
+            $in = filter_var($_REQUEST[$as], $filter, $filter_options);
 
         // Otherwise, if no filter is specified.
         } else {
             // Kill slashes and use the standard WordPress wp_kses_post() function to do the filtering
             $in = '';
-            if (isset($_POST[$as])) {
-                $in = wp_kses_post(stripslashes($_POST[$as]));
+            if (isset($_REQUEST[$as])) {
+                $in = wp_kses_post(stripslashes($_REQUEST[$as]));
             }
         }
 
@@ -1354,7 +1354,7 @@ $forEdit = true;
        $filter = FILTER_SANITIZE_STRING;
        $filter_options = FILTER_FLAG_NO_ENCODE_QUOTES;
 
-       $in = filter_input(INPUT_POST, $as, $filter, $filter_options);
+       $in = filter_var($_REQUEST[$as], $filter, $filter_options);
        if (isset($f['required']) && $f['required'] && trim($in) == '') {
                $this->inputFieldStatus = false;
                $this->inputErrorReason = 'Required input not provided.';
@@ -1565,7 +1565,7 @@ $forEdit = true;
 
         $this->inputFieldStatus = true;
 
-        $in = filter_input(INPUT_POST, $as, FILTER_VALIDATE_EMAIL);
+        $in = filter_var($_REQUEST[$as], FILTER_VALIDATE_EMAIL);
         if (isset($f['required']) && $f['required'] && trim($in) == '') {
             $this->inputFieldStatus = false;
             $this->inputErrorReason = 'E-Mail address does not appear to be valid.';