diff options
Diffstat (limited to 'phpBB/includes/functions_upload.php')
-rw-r--r-- | phpBB/includes/functions_upload.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index b4e165502b..c640865212 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -1,9 +1,13 @@ <?php /** * -* @package phpBB3 -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB')) /** * Responsible for holding all file relevant information, as well as doing file-specific operations. * The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. -* @package phpBB3 */ class filespec { @@ -308,6 +311,9 @@ class filespec if (file_exists($this->destination_file) && !$overwrite) { @unlink($this->filename); + $this->error[] = $user->lang($this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR', $this->destination_file); + $this->file_moved = false; + return false; } else { @@ -455,8 +461,6 @@ class filespec /** * Class for assigning error messages before a real filespec class can be assigned -* -* @package phpBB3 */ class fileerror extends filespec { @@ -469,8 +473,6 @@ class fileerror extends filespec /** * File upload class * Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads -* -* @package phpBB3 */ class fileupload { @@ -1049,7 +1051,7 @@ class fileupload */ static public function image_types() { - return array( + $result = array( IMAGETYPE_GIF => array('gif'), IMAGETYPE_JPEG => array('jpg', 'jpeg'), IMAGETYPE_PNG => array('png'), @@ -1062,10 +1064,16 @@ class fileupload IMAGETYPE_JP2 => array('jpg', 'jpeg'), IMAGETYPE_JPX => array('jpg', 'jpeg'), IMAGETYPE_JB2 => array('jpg', 'jpeg'), - IMAGETYPE_SWC => array('swc'), IMAGETYPE_IFF => array('iff'), IMAGETYPE_WBMP => array('wbmp'), IMAGETYPE_XBM => array('xbm'), ); + + if (defined('IMAGETYPE_SWC')) + { + $result[IMAGETYPE_SWC] = array('swc'); + } + + return $result; } } |