mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/10939] Added $_FILES handling to phpbb_request
PHPBB3-10939
This commit is contained in:
@@ -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',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -283,6 +284,18 @@ class phpbb_request implements phpbb_request_interface
|
||||
return $this->server($var_name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function file($form_name)
|
||||
{
|
||||
return $this->variable($form_name, array(), 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
|
||||
|
Reference in New Issue
Block a user