aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/symfony_request.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-11-07 11:10:26 +0100
committerTristan Darricau <github@nicofuma.fr>2014-11-07 11:10:26 +0100
commit122c1c6e05c0c7d1fe282ecd09d833405c975993 (patch)
tree7b88fc3bfe7792b730c20a24bd31b4bacb2deb8f /phpBB/phpbb/symfony_request.php
parent29d2a7bc9f0afd074fd0b4afdf9015a70bd06940 (diff)
parenta1b58d05d158ff7afd789c1b27821e17198f8d58 (diff)
downloadforums-122c1c6e05c0c7d1fe282ecd09d833405c975993.tar
forums-122c1c6e05c0c7d1fe282ecd09d833405c975993.tar.gz
forums-122c1c6e05c0c7d1fe282ecd09d833405c975993.tar.bz2
forums-122c1c6e05c0c7d1fe282ecd09d833405c975993.tar.xz
forums-122c1c6e05c0c7d1fe282ecd09d833405c975993.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/13280] Remove unneeded str_replace in build_url() [ticket/13280] Only run sanitizer for server superglobal and modify tests [ticket/13280] Seperate server sanitizer call and add comment [ticket/13280] Add additional sanitizer for ampersands in server superglobal [ticket/13280] Correctly format user page for build_url() [ticket/13280] Properly format the current page and add sanitizer to tests
Diffstat (limited to 'phpBB/phpbb/symfony_request.php')
-rw-r--r--phpBB/phpbb/symfony_request.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php
index ad949a35f2..02d22c480f 100644
--- a/phpBB/phpbb/symfony_request.php
+++ b/phpBB/phpbb/symfony_request.php
@@ -30,6 +30,12 @@ class symfony_request extends Request
$type_cast_helper->set_var($value, $value, gettype($value), true);
};
+ // This function is meant for additional handling of server variables
+ $server_sanitizer = function(&$value, $key) use ($sanitizer) {
+ $sanitizer($value, $key);
+ $value = str_replace('&amp;', '&', $value);
+ };
+
$get_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::GET);
$post_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::POST);
$server_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::SERVER);
@@ -38,10 +44,12 @@ class symfony_request extends Request
array_walk_recursive($get_parameters, $sanitizer);
array_walk_recursive($post_parameters, $sanitizer);
- array_walk_recursive($server_parameters, $sanitizer);
array_walk_recursive($files_parameters, $sanitizer);
array_walk_recursive($cookie_parameters, $sanitizer);
+ // Run special sanitizer for server superglobal
+ array_walk_recursive($server_parameters, $server_sanitizer);
+
parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
}
}