diff options
Diffstat (limited to 'core/Common.php')
-rw-r--r-- | core/Common.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/Common.php b/core/Common.php index 1ed8d48935..2a9d3cbe0a 100644 --- a/core/Common.php +++ b/core/Common.php @@ -379,9 +379,13 @@ class Common */ private static function undoMagicQuotes($value) { - if (version_compare(PHP_VERSION, '5.4', '<') && - get_magic_quotes_gpc()) { + static $shouldUndo; + if (!isset($shouldUndo)) { + $shouldUndo = version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc(); + } + + if ($shouldUndo) { $value = stripslashes($value); } @@ -470,7 +474,7 @@ class Common } $value = self::sanitizeInputValues($requestArrayToUse[$varName]); - if (!is_null($varType)) { + if (isset($varType)) { $ok = false; if ($varType === 'string') { |