aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-13 09:52:02 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-13 09:52:02 -0500
commitaa710df2db2512f6065f91dcf8b5fc7d100edf41 (patch)
tree89ae712128b68db41237e032315dcbf17dea1108 /phpBB/includes/functions.php
parenta194e6ce7afe373fcb89ab26b3d057f60d10fa3d (diff)
downloadforums-aa710df2db2512f6065f91dcf8b5fc7d100edf41.tar
forums-aa710df2db2512f6065f91dcf8b5fc7d100edf41.tar.gz
forums-aa710df2db2512f6065f91dcf8b5fc7d100edf41.tar.bz2
forums-aa710df2db2512f6065f91dcf8b5fc7d100edf41.tar.xz
forums-aa710df2db2512f6065f91dcf8b5fc7d100edf41.zip
[ticket/11832] Create phpbb_symfony_request to handle initiating symfony_request
Now symfony_request is also a service (removed the function phpbb_create_symfony_request). Inject symfony request into filesystem Cleanup for the tests PHPBB3-11832
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 49d4e03921..ab4df9be54 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5708,44 +5708,3 @@ function phpbb_convert_30_dbms_to_31($dbms)
throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
}
-
-/**
-* Create a Symfony Request object from phpbb_request object
-*
-* @param phpbb_request $request Request object
-* @return Request A Symfony Request object
-*/
-function phpbb_create_symfony_request(phpbb_request $request)
-{
- // If we have already gotten it, don't go back through all the trouble of
- // creating it again; instead, just return it. This allows multiple calls
- // of this method so we don't have to globalize $symfony_request in other
- // functions.
- static $symfony_request;
- if (null !== $symfony_request)
- {
- return $symfony_request;
- }
-
- // This function is meant to sanitize the global input arrays
- $sanitizer = function(&$value, $key) {
- $type_cast_helper = new phpbb_request_type_cast_helper();
- $type_cast_helper->set_var($value, $value, gettype($value), true);
- };
-
- // We need to re-enable the super globals so we can access them here
- $request->enable_super_globals();
- $get_parameters = $_GET;
- $post_parameters = $_POST;
- $server_parameters = $_SERVER;
- $files_parameters = $_FILES;
- $cookie_parameters = $_COOKIE;
- // And now disable them again for security
- $request->disable_super_globals();
-
- array_walk_recursive($get_parameters, $sanitizer);
- array_walk_recursive($post_parameters, $sanitizer);
-
- $symfony_request = new Symfony\Component\HttpFoundation\Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
- return $symfony_request;
-}