mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/15742] Remove addslashes_recursively()
PHPBB3-15742
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
@@ -18,13 +18,6 @@ namespace phpbb\request;
|
||||
*/
|
||||
interface 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);
|
||||
|
||||
/**
|
||||
* Set variable $result to a particular type.
|
||||
*
|
||||
|
Reference in New Issue
Block a user