aboutsummaryrefslogtreecommitdiffstats
path: root/tests/security
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-11-12 10:30:27 +0100
committerTristan Darricau <github@nicofuma.fr>2014-11-12 15:42:23 +0100
commit6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5 (patch)
tree38f9fb1f71a00ae147a9adf74c8af410fa8e9fea /tests/security
parentcd6085ebdc3780d1b4551da5fa93d18acc4d11e5 (diff)
downloadforums-6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5.tar
forums-6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5.tar.gz
forums-6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5.tar.bz2
forums-6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5.tar.xz
forums-6d533d2f8630d5bed2bfdbfd09cc9c689fbad1b5.zip
[ticket/13280] Revert "Merge pull request #3107 from marc1706/ticket/13280"
This reverts commit a1b58d05d158ff7afd789c1b27821e17198f8d58, reversing changes made to 0e772afb9db640e54e84cfccaddcf74f3edbb3fb. PHPBB3-13280
Diffstat (limited to 'tests/security')
-rw-r--r--tests/security/extract_current_page_test.php28
1 files changed, 8 insertions, 20 deletions
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index c127b69b2b..58dea68dc8 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -37,16 +37,16 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
));
$symfony_request->expects($this->any())
->method('getScriptName')
- ->will($this->returnValue($this->sanitizer($url)));
+ ->will($this->returnValue($url));
$symfony_request->expects($this->any())
->method('getQueryString')
- ->will($this->returnValue($this->sanitizer($query_string)));
+ ->will($this->returnValue($query_string));
$symfony_request->expects($this->any())
->method('getBasePath')
->will($this->returnValue($server['REQUEST_URI']));
- $symfony_request->expects($this->sanitizer($this->any()))
+ $symfony_request->expects($this->any())
->method('getPathInfo')
- ->will($this->returnValue($this->sanitizer('/')));
+ ->will($this->returnValue('/'));
$result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with PHP_SELF filled.';
@@ -65,32 +65,20 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
));
$symfony_request->expects($this->any())
->method('getScriptName')
- ->will($this->returnValue($this->sanitizer($url)));
+ ->will($this->returnValue($url));
$symfony_request->expects($this->any())
->method('getQueryString')
- ->will($this->returnValue($this->sanitizer($query_string)));
+ ->will($this->returnValue($query_string));
$symfony_request->expects($this->any())
->method('getBasePath')
- ->will($this->returnValue($this->sanitizer($server['REQUEST_URI'])));
+ ->will($this->returnValue($server['REQUEST_URI']));
$symfony_request->expects($this->any())
->method('getPathInfo')
- ->will($this->returnValue($this->sanitizer('/')));
+ ->will($this->returnValue('/'));
$result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with REQUEST_URI filled.';
$this->assertEquals($expected, $result['query_string'], $label);
}
-
- protected function sanitizer($value)
- {
- // Fix for objects passed in phpunit
- if (is_object($value))
- {
- return $value;
- }
- $type_cast_helper = new \phpbb\request\type_cast_helper();
- $type_cast_helper->set_var($value, $value, gettype($value), true);
- return str_replace('&amp;', '&', $value);
- }
}