From 7a6a16e3a52128179a4f518958f22e773dd94084 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 5 Dec 2015 13:45:16 +0100 Subject: [ticket/13454] Remove unused variables This is part 5 and there is more to come. PHPBB3-13454 --- phpBB/phpbb/request/type_cast_helper.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/phpbb/request/type_cast_helper.php') diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index bc654e6182..96e66950ca 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -172,7 +172,6 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface } list($default_key, $default_value) = each($default); - $value_type = gettype($default_value); $key_type = gettype($default_key); $_var = $var; -- cgit v1.2.1 From 8eb48e281287646bb186f831e4f076f4557a14a9 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 6 Sep 2018 14:15:08 +0200 Subject: [ticket/15742] Remove get_magic_quotes_gpc() call PHPBB3-15742 --- phpBB/phpbb/request/type_cast_helper.php | 37 -------------------------------- 1 file changed, 37 deletions(-) (limited to 'phpBB/phpbb/request/type_cast_helper.php') 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. * @@ -68,19 +46,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. * @@ -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; } } -- cgit v1.2.1 From 89d1401a77f7a2f9ee067b90efa975e21363e914 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 13 Sep 2018 18:47:14 +0200 Subject: [ticket/15742] Remove addslashes_recursively() PHPBB3-15742 --- phpBB/phpbb/request/type_cast_helper.php | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'phpBB/phpbb/request/type_cast_helper.php') diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index 1a53206c74..912494998d 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -18,34 +18,6 @@ namespace phpbb\request; */ class type_cast_helper implements \phpbb\request\type_cast_helper_interface { - /** - * Recursively applies addslashes to a variable. - * - * @param mixed &$var Variable passed by reference to which slashes will be added. - */ - public function addslashes_recursively(&$var) - { - if (is_string($var)) - { - $var = addslashes($var); - } - else if (is_array($var)) - { - $var_copy = $var; - $var = array(); - foreach ($var_copy as $key => $value) - { - if (is_string($key)) - { - $key = addslashes($key); - } - $var[$key] = $value; - - $this->addslashes_recursively($var[$key]); - } - } - } - /** * Set variable $result to a particular type. * -- cgit v1.2.1