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.
This commit is contained in:
@@ -94,13 +94,12 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user