diff options
Diffstat (limited to 'phpBB/phpbb/files/upload.php')
-rw-r--r-- | phpBB/phpbb/files/upload.php | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index 09f2b9408d..471c9c378f 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -200,86 +200,6 @@ class upload } /** - * Move file from another location to phpBB - * - * @param string $source_file Filename of source file - * @param array|bool $filedata Array with filedata or false - * - * @return filespec Object "filespec" is returned, all further operations can be done with this object - */ - function local_upload($source_file, $filedata = false) - { - $upload = array(); - - $upload['local_mode'] = true; - $upload['tmp_name'] = $source_file; - - if ($filedata === false) - { - $upload['name'] = utf8_basename($source_file); - $upload['size'] = 0; - } - else - { - $upload['name'] = $filedata['realname']; - $upload['size'] = $filedata['size']; - $upload['type'] = $filedata['type']; - } - - /** @var filespec $file */ - $file = $this->factory->get('filespec') - ->set_upload_ary($upload) - ->set_upload_namespace($this); - - if ($file->init_error()) - { - $file->error[] = ''; - return $file; - } - - if (isset($upload['error'])) - { - $error = $this->assign_internal_error($upload['error']); - - if ($error !== false) - { - $file->error[] = $error; - return $file; - } - } - - // PHP Upload filesize exceeded - if ($file->get('filename') == 'none') - { - $max_filesize = @ini_get('upload_max_filesize'); - $unit = 'MB'; - - if (!empty($max_filesize)) - { - $unit = strtolower(substr($max_filesize, -1, 1)); - $max_filesize = (int) $max_filesize; - - $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); - } - - $file->error[] = (empty($max_filesize)) ?$this->language->lang($this->error_prefix . 'PHP_SIZE_NA') : $this->language->lang($this->error_prefix . 'PHP_SIZE_OVERRUN', $max_filesize, $this->language->lang($unit)); - return $file; - } - - // Not correctly uploaded - if (!$file->is_uploaded()) - { - $file->error[] = $this->language->lang($this->error_prefix . 'NOT_UPLOADED'); - return $file; - } - - $this->common_checks($file); - $this->request->overwrite('local', $upload, request_interface::FILES); - - return $file; - } - - /** * Remote upload method * Uploads file from given url * |