mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13904] Use the class member plupload instead of argument
PHPBB3-13904
This commit is contained in:
parent
f9b69e73d4
commit
cf9b6ed474
1 changed files with 4 additions and 5 deletions
|
@ -52,7 +52,7 @@ class form implements type_interface
|
|||
public function upload()
|
||||
{
|
||||
$args = func_get_args();
|
||||
return $this->form_upload($args[0], (isset($args[1])) ? $args[1] : null);
|
||||
return $this->form_upload($args[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,19 +70,18 @@ class form implements type_interface
|
|||
* Upload file from users harddisk
|
||||
*
|
||||
* @param string $form_name Form name assigned to the file input field (if it is an array, the key has to be specified)
|
||||
* @param plupload $plupload The plupload object
|
||||
*
|
||||
* @return filespec $file Object "filespec" is returned, all further operations can be done with this object
|
||||
* @access public
|
||||
*/
|
||||
protected function form_upload($form_name, plupload $plupload = null)
|
||||
protected function form_upload($form_name)
|
||||
{
|
||||
$upload = $this->request->file($form_name);
|
||||
unset($upload['local_mode']);
|
||||
|
||||
if ($plupload)
|
||||
if ($this->plupload)
|
||||
{
|
||||
$result = $plupload->handle_upload($form_name);
|
||||
$result = $this->plupload->handle_upload($form_name);
|
||||
if (is_array($result))
|
||||
{
|
||||
$upload = array_merge($upload, $result);
|
||||
|
|
Loading…
Add table
Reference in a new issue