From aa710df2db2512f6065f91dcf8b5fc7d100edf41 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 13 Sep 2013 09:52:02 -0500 Subject: [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 --- phpBB/phpbb/symfony_request.php | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 phpBB/phpbb/symfony_request.php (limited to 'phpBB/phpbb/symfony_request.php') diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php new file mode 100644 index 0000000000..29ab8c000e --- /dev/null +++ b/phpBB/phpbb/symfony_request.php @@ -0,0 +1,46 @@ +set_var($value, $value, gettype($value), true); + }; + + $get_parameters = $phpbb_request->get_super_global(phpbb_request_interface::GET); + $post_parameters = $phpbb_request->get_super_global(phpbb_request_interface::POST); + $server_parameters = $phpbb_request->get_super_global(phpbb_request_interface::SERVER); + $files_parameters = $phpbb_request->get_super_global(phpbb_request_interface::FILES); + $cookie_parameters = $phpbb_request->get_super_global(phpbb_request_interface::COOKIE); + + array_walk_recursive($get_parameters, $sanitizer); + array_walk_recursive($post_parameters, $sanitizer); + + parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters); + } +} -- cgit v1.2.1 From 9d8ac2b0ceb24dd14df61d083505941afb1b52c4 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 17 Sep 2013 17:12:41 +0200 Subject: [ticket/11700] Fix unit tests after develop merge PHPBB3-11700 --- phpBB/phpbb/symfony_request.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'phpBB/phpbb/symfony_request.php') diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php index 29ab8c000e..92784c213b 100644 --- a/phpBB/phpbb/symfony_request.php +++ b/phpBB/phpbb/symfony_request.php @@ -7,6 +7,8 @@ * */ +namespace phpbb; + use Symfony\Component\HttpFoundation\Request; /** @@ -17,26 +19,26 @@ if (!defined('IN_PHPBB')) exit; } -class phpbb_symfony_request extends Request +class symfony_request extends Request { /** * Constructor * - * @param phpbb_request_interface $phpbb_request + * @param phpbb\request\request_interface $phpbb_request */ - public function __construct(phpbb_request_interface $phpbb_request) + public function __construct(\phpbb\request\request_interface $phpbb_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 = new \phpbb\request\type_cast_helper(); $type_cast_helper->set_var($value, $value, gettype($value), true); }; - $get_parameters = $phpbb_request->get_super_global(phpbb_request_interface::GET); - $post_parameters = $phpbb_request->get_super_global(phpbb_request_interface::POST); - $server_parameters = $phpbb_request->get_super_global(phpbb_request_interface::SERVER); - $files_parameters = $phpbb_request->get_super_global(phpbb_request_interface::FILES); - $cookie_parameters = $phpbb_request->get_super_global(phpbb_request_interface::COOKIE); + $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); + $files_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::FILES); + $cookie_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::COOKIE); array_walk_recursive($get_parameters, $sanitizer); array_walk_recursive($post_parameters, $sanitizer); -- cgit v1.2.1