From: Huji Date: Thu, 3 Jan 2008 17:37:59 +0000 (+0000) Subject: More explanatory messages shown when an upload error happens. X-Git-Tag: 1.31.0-rc.0~50163 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=891c16f90572b3e5afd589246cf7c4d97535ae3f;p=lhc%2Fweb%2Fwiklou.git More explanatory messages shown when an upload error happens. --- diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 64aa4cbc47..61d7ef780b 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -850,7 +850,15 @@ class ImportStreamSource { return new WikiErrorMsg( 'importnofile' ); } if( !empty( $upload['error'] ) ) { - return new WikiErrorMsg( 'importuploaderror', $upload['error'] ); + switch($upload['error']){ + case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini. + return new WikiErrorMsg( 'importuploaderror' ); + case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form. + return new WikiErrorMsg( 'importuploaderrorsize' ); + case 3: # The uploaded file was only partially uploaded + return new WikiErrorMsg( 'importuploaderrorpartial' ); + } + } $fname = $upload['tmp_name']; if( is_uploaded_file( $fname ) ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d5a4c1a4c3..bb3a9febf5 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2301,7 +2301,8 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]] 'importhistoryconflict' => 'Conflicting history revision exists (may have imported this page before)', 'importnosources' => 'No transwiki import sources have been defined and direct history uploads are disabled.', 'importnofile' => 'No import file was uploaded.', -'importuploaderror' => 'Upload of import file failed; perhaps the file is bigger than the allowed upload size.', +'importuploaderrorsize' => 'Upload of import file failed. The file is bigger than the allowed upload size.', +'importuploaderrorpartial' => 'Upload of import file failed. The file was only partially uploaded.', # Import log 'importlogpage' => 'Import log', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 61c918005a..9091665a1d 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1553,7 +1553,8 @@ $wgMessageStructure = array( 'importhistoryconflict', 'importnosources', 'importnofile', - 'importuploaderror', + 'importuploaderrorsize', + 'importuploaderrorpartial', ), 'importlog' => array( 'importlogpage',