diff options
| author | Nils Adermann <naderman@naderman.de> | 2014-11-16 16:50:29 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2014-11-16 16:50:29 +0100 |
| commit | 6104be6b4d37f6ce569fde95c88400724dabac13 (patch) | |
| tree | d92f43d438d5b6516a3538f826c81fe29522f2ab /phpBB/phpbb/request | |
| parent | f1b88706b8930186c8a2dbe216769e2f8350af38 (diff) | |
| parent | 4ffdb129388d72cdcc790f1c3713e3770d8aeca9 (diff) | |
| download | forums-6104be6b4d37f6ce569fde95c88400724dabac13.tar forums-6104be6b4d37f6ce569fde95c88400724dabac13.tar.gz forums-6104be6b4d37f6ce569fde95c88400724dabac13.tar.bz2 forums-6104be6b4d37f6ce569fde95c88400724dabac13.tar.xz forums-6104be6b4d37f6ce569fde95c88400724dabac13.zip | |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus:
[ticket/13280] Output escaping for the symfony request object
[ticket/13280] Add new tests
[ticket/13280] Make the tests failing
[ticket/13280] Revert "Merge pull request #3107 from marc1706/ticket/13280"
Diffstat (limited to 'phpBB/phpbb/request')
| -rw-r--r-- | phpBB/phpbb/request/request.php | 23 | ||||
| -rw-r--r-- | phpBB/phpbb/request/request_interface.php | 10 |
2 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index ea9854894c..f0f2f7e2a2 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -416,4 +416,27 @@ class request implements \phpbb\request\request_interface { return $this->input[$super_global]; } + + /** + * {@inheritdoc} + */ + public function escape($var, $multibyte) + { + if (is_array($var)) + { + $result = array(); + foreach ($var as $key => $value) + { + $this->type_cast_helper->set_var($key, $key, gettype($key), $multibyte); + $result[$key] = $this->escape($value, $multibyte); + } + $var = $result; + } + else + { + $this->type_cast_helper->set_var($var, $var, 'string', $multibyte); + } + + return $var; + } } diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php index 3236f73990..47b3b3a4ed 100644 --- a/phpBB/phpbb/request/request_interface.php +++ b/phpBB/phpbb/request/request_interface.php @@ -142,4 +142,14 @@ interface request_interface * @return array The original array of the requested super global. */ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Escape a string variable. + * + * @param mixed $value The contents to fill with + * @param bool $multibyte Indicates whether string values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks. + * @return string|array + */ + public function escape($value, $multibyte); } |
