filter: Clear whitespace for input numbers

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-07-06 16:19:59 +02:00
committed by Chris Morgan
parent 8bc3b29bd4
commit 017d2d68a0

View File

@@ -66,6 +66,8 @@ function filter_gpc()
$aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]];
else if(empty($_REQUEST[$aKeys[$i]]))
$aClean[$aKeys[$i]] = 0;
else if(is_numeric(trim($_REQUEST[$aKeys[$i]]))) // try clearing whitespace
$aClean[$aKeys[$i]] = trim($_REQUEST[$aKeys[$i]]);
else
return "Fatal error: ".$aKeys[$i]." should be a numeric value. ".
$sErrorSuggestion;