From f8fb363ce42eba353ac74f7871cb3663b2b9df0a Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sun, 14 Sep 2008 11:19:08 -0400 Subject: [PATCH] filter_gpc() fix for "Fatal error: type of variable X is not recognized". Ignore unknown gpc variables instead of failing with fatal errors as it isn't useful to report these errors to users. Firewalls or other programs may be inserting these cookies. Properly store array variables if they are valid arrays. --- include/filter.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/filter.php b/include/filter.php index 4daf875..404e3a1 100644 --- a/include/filter.php +++ b/include/filter.php @@ -94,17 +94,16 @@ function filter_gpc() } break; case "a": // array - if(!is_array($_REQUEST[$aKeys[$i]])) - return "Fatal error: ".$aKeys[$i]." should be an array. ". - $sErrorSuggestion; + // store the value if it is an array + if(is_array($_REQUEST[$aKeys[$i]])) + $aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]]; break; default: - return "Fatal error: type of variable ".$aKeys[$i]." is not recognized.". - $sErrorSuggestion; + // type not recognized, skip it break; } } - + /* null out all input data so we can be assured that */ /* no unfiltered values are being used */ $_REQUEST = array();