mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10939] Added $_FILES handling to phpbb_request
PHPBB3-10939
This commit is contained in:
parent
64ff06cf87
commit
74423eaf12
2 changed files with 14 additions and 0 deletions
|
@ -30,6 +30,7 @@ interface phpbb_request_interface
|
|||
const REQUEST = 2;
|
||||
const COOKIE = 3;
|
||||
const SERVER = 4;
|
||||
const FILES = 5;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue