diff --git a/phpBB/phpbb/request/interface.php b/phpBB/phpbb/request/interface.php index 741db35917..8d472af97a 100644 --- a/phpBB/phpbb/request/interface.php +++ b/phpBB/phpbb/request/interface.php @@ -136,4 +136,14 @@ interface phpbb_request_interface * Pay attention when using these, they are unsanitised! */ public function variable_names($super_global = phpbb_request_interface::REQUEST); + + /** + * Returns the original array of the requested super global + * + * @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global + * The super global which will be returned + * + * @return array The original array of the requested super global. + */ + public function original_global_values($super_global = phpbb_request_interface::REQUEST); } diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index ae3c526d89..a4e9a2c2b3 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -412,4 +412,12 @@ class phpbb_request implements phpbb_request_interface return $var; } + + /** + * {@inheritdoc} + */ + public function original_global_values($super_global = phpbb_request_interface::REQUEST) + { + return $this->input[$super_global]; + } } diff --git a/tests/mock/request.php b/tests/mock/request.php index 2a272fc03b..d70dd1eae9 100644 --- a/tests/mock/request.php +++ b/tests/mock/request.php @@ -74,6 +74,11 @@ class phpbb_mock_request implements phpbb_request_interface return array_keys($this->data[$super_global]); } + public function original_global_values($super_global = phpbb_request_interface::REQUEST) + { + return $this->data[$super_global]; + } + /* custom methods */ public function set_header($header_name, $value)