diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-11-10 23:49:29 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-11-10 23:49:29 +0100 |
commit | e86ecc0f3bd6383d31a670896720a970b8faaaa9 (patch) | |
tree | 0bb5af4cffd3b53f3225ea2c72670e343709d86d /phpBB/includes/request | |
parent | 847feb07e784ccbe646257553f1efba8c5032b7f (diff) | |
parent | 1f9bff2126bbec514c4a7b675723bfe7f26c432e (diff) | |
download | forums-e86ecc0f3bd6383d31a670896720a970b8faaaa9.tar forums-e86ecc0f3bd6383d31a670896720a970b8faaaa9.tar.gz forums-e86ecc0f3bd6383d31a670896720a970b8faaaa9.tar.bz2 forums-e86ecc0f3bd6383d31a670896720a970b8faaaa9.tar.xz forums-e86ecc0f3bd6383d31a670896720a970b8faaaa9.zip |
Merge remote-tracking branch 'Fyorl/ticket/10939' into develop
* Fyorl/ticket/10939:
[ticket/10939] Added documentation for phpbb_request::file
[ticket/10939] Added tests for phpbb_request::file
[ticket/10939] Modified the default return for $request->file
[ticket/10939] Modified fileupload tests to deal with new behaviour
[ticket/10939] Modified mock request class to handle deactivated $_FILES
[ticket/10939] Modified acp_groups.php to not use $_FILES
[ticket/10939] Modified ucp_groups.php to not use $_FILES
[ticket/10939] Modified functions_user.php to not use $_FILES
[ticket/10939] Modified message_parser.php to not use $_FILES
[ticket/10939] Modified functions_upload to not use $_FILES
[ticket/10939] Modified request test slightly to include $_FILES
[ticket/10939] Added $_FILES handling to phpbb_request
Diffstat (limited to 'phpBB/includes/request')
-rw-r--r-- | phpBB/includes/request/interface.php | 1 | ||||
-rw-r--r-- | phpBB/includes/request/request.php | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/phpBB/includes/request/interface.php b/phpBB/includes/request/interface.php index afd53002e3..741db35917 100644 --- a/phpBB/includes/request/interface.php +++ b/phpBB/includes/request/interface.php @@ -30,6 +30,7 @@ interface phpbb_request_interface const REQUEST = 2; const COOKIE = 3; const SERVER = 4; + const FILES = 5; /**#@-*/ /** diff --git a/phpBB/includes/request/request.php b/phpBB/includes/request/request.php index a06fc0d85d..ae3c526d89 100644 --- a/phpBB/includes/request/request.php +++ b/phpBB/includes/request/request.php @@ -34,6 +34,7 @@ class phpbb_request implements phpbb_request_interface phpbb_request_interface::REQUEST => '_REQUEST', phpbb_request_interface::COOKIE => '_COOKIE', phpbb_request_interface::SERVER => '_SERVER', + phpbb_request_interface::FILES => '_FILES', ); /** @@ -269,6 +270,19 @@ class phpbb_request implements phpbb_request_interface } /** + * Shortcut method to retrieve $_FILES variables + * + * @param string $form_name The name of the file input form element + * + * @return array The uploaded file's information or an empty array if the + * variable does not exist in _FILES. + */ + public function file($form_name) + { + return $this->variable($form_name, array('name' => 'none'), false, phpbb_request_interface::FILES); + } + + /** * Checks whether a certain variable was sent via POST. * To make sure that a request was sent using POST you should call this function * on at least one variable. |