diff options
author | Jakub Senko <jakubsenko@gmail.com> | 2018-09-06 14:15:08 +0200 |
---|---|---|
committer | Jakub Senko <jakubsenko@gmail.com> | 2018-09-06 14:52:35 +0200 |
commit | 8eb48e281287646bb186f831e4f076f4557a14a9 (patch) | |
tree | 6da35370e578db56831a447d7c6e041397148f22 /phpBB/phpbb/request | |
parent | bd90a5358969e2bb82df34727ed8f6575781e5d2 (diff) | |
download | forums-8eb48e281287646bb186f831e4f076f4557a14a9.tar forums-8eb48e281287646bb186f831e4f076f4557a14a9.tar.gz forums-8eb48e281287646bb186f831e4f076f4557a14a9.tar.bz2 forums-8eb48e281287646bb186f831e4f076f4557a14a9.tar.xz forums-8eb48e281287646bb186f831e4f076f4557a14a9.zip |
[ticket/15742] Remove get_magic_quotes_gpc() call
PHPBB3-15742
Diffstat (limited to 'phpBB/phpbb/request')
-rw-r--r-- | phpBB/phpbb/request/request.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/request/type_cast_helper.php | 37 | ||||
-rw-r--r-- | phpBB/phpbb/request/type_cast_helper_interface.php | 7 |
3 files changed, 0 insertions, 46 deletions
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index 00be8fd381..a0267d1370 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -150,8 +150,6 @@ class request implements \phpbb\request\request_interface return; } - $this->type_cast_helper->add_magic_quotes($value); - // setting to null means unsetting if ($value === null) { diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index 96e66950ca..1a53206c74 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -18,28 +18,6 @@ namespace phpbb\request; */ class type_cast_helper implements \phpbb\request\type_cast_helper_interface { - - /** - * @var string Whether slashes need to be stripped from input - */ - protected $strip; - - /** - * Initialises the type cast helper class. - * All it does is find out whether magic quotes are turned on. - */ - public function __construct() - { - if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) - { - $this->strip = false; - } - else - { - $this->strip = (@get_magic_quotes_gpc()) ? true : false; - } - } - /** * Recursively applies addslashes to a variable. * @@ -69,19 +47,6 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface } /** - * Recursively applies addslashes to a variable if magic quotes are turned on. - * - * @param mixed &$var Variable passed by reference to which slashes will be added. - */ - public function add_magic_quotes(&$var) - { - if ($this->strip) - { - $this->addslashes_recursively($var); - } - } - - /** * Set variable $result to a particular type. * * @param mixed &$result The variable to fill @@ -129,8 +94,6 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface $result = preg_replace('/[\x80-\xFF]/', '?', $result); } } - - $result = ($this->strip) ? stripslashes($result) : $result; } } diff --git a/phpBB/phpbb/request/type_cast_helper_interface.php b/phpBB/phpbb/request/type_cast_helper_interface.php index 2cb28d021f..e22712dc0c 100644 --- a/phpBB/phpbb/request/type_cast_helper_interface.php +++ b/phpBB/phpbb/request/type_cast_helper_interface.php @@ -26,13 +26,6 @@ interface type_cast_helper_interface public function addslashes_recursively(&$var); /** - * Recursively applies addslashes to a variable if magic quotes are turned on. - * - * @param mixed &$var Variable passed by reference to which slashes will be added. - */ - public function add_magic_quotes(&$var); - - /** * Set variable $result to a particular type. * * @param mixed &$result The variable to fill |