mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
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
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',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -268,6 +269,19 @@ 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 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
|
||||
|
Reference in New Issue
Block a user