Trim 's' and 'sh' variables in filter.php so we correctly convert variable values with spaces into "" strings

This commit is contained in:
Jonathan Ernst
2006-07-18 02:42:57 +00:00
committed by WineHQ
parent 0019810922
commit 3a61131ffd

View File

@@ -32,10 +32,13 @@ function filter_gpc()
switch($aKeys[$i][1]) switch($aKeys[$i][1])
{ {
case "h": // HTML string case "h": // HTML string
$aClean[$aKeys[$i]] = htmlspecialchars($_REQUEST[$aKeys[$i]]); $aClean[$aKeys[$i]] = trim(htmlspecialchars($_REQUEST[$aKeys[$i]]));
// if there is no content and no image, make the variable empty
if(strip_tags($aClean[$aKeys[$i]],'<img>')=="")
$aClean[$aKeys[$i]] = "";
break; break;
default: // normal string (no HTML) default: // normal string (no HTML)
$aClean[$aKeys[$i]] = strip_tags($_REQUEST[$aKeys[$i]]); $aClean[$aKeys[$i]] = trim(strip_tags($_REQUEST[$aKeys[$i]]));
break; break;
} }
break; break;