# HG changeset patch # User Matti Hamalainen # Date 1425880995 -7200 # Node ID 668fd0ea4e08a563b88907cbe2cf6dd8dbc2b15d # Parent 13b15cef702860168e89b1c77b19a632be110a2c Add check for request items that might not be strings. Only "trim" the value if it's a string. diff -r 13b15cef7028 -r 668fd0ea4e08 msitegen.inc.php --- a/msitegen.inc.php Thu Jan 15 10:33:47 2015 +0200 +++ b/msitegen.inc.php Mon Mar 09 08:03:15 2015 +0200 @@ -516,12 +516,21 @@ } +function stTrimIfString($val) +{ + if (is_string($val)) + return trim($val); + else + return $val; +} + + function stGetRequestItem($name, $default = "", $allowGet = FALSE) { if ($allowGet || stGetSetting("debug")) - return isset($_REQUEST[$name]) ? trim($_REQUEST[$name]) : $default; + return isset($_REQUEST[$name]) ? stTrimIfString($_REQUEST[$name]) : $default; else - return isset($_POST[$name]) ? trim($_POST[$name]) : $default; + return isset($_POST[$name]) ? stTrimIfString($_POST[$name]) : $default; }