diff options
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. |