r29220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29219‎ | r29220 | r29221 >
Date:17:37, 3 January 2008
Author:huji
Status:old
Tags:
Comment:
More explanatory messages shown when an upload error happens.
Modified paths:
  • /trunk/phase3/includes/SpecialImport.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1553,7 +1553,8 @@
15541554 'importhistoryconflict',
15551555 'importnosources',
15561556 'importnofile',
1557 - 'importuploaderror',
 1557+ 'importuploaderrorsize',
 1558+ 'importuploaderrorpartial',
15581559 ),
15591560 'importlog' => array(
15601561 'importlogpage',
Index: trunk/phase3/includes/SpecialImport.php
@@ -850,7 +850,15 @@
851851 return new WikiErrorMsg( 'importnofile' );
852852 }
853853 if( !empty( $upload['error'] ) ) {
854 - return new WikiErrorMsg( 'importuploaderror', $upload['error'] );
 854+ switch($upload['error']){
 855+ case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
 856+ return new WikiErrorMsg( 'importuploaderror' );
 857+ case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
 858+ return new WikiErrorMsg( 'importuploaderrorsize' );
 859+ case 3: # The uploaded file was only partially uploaded
 860+ return new WikiErrorMsg( 'importuploaderrorpartial' );
 861+ }
 862+
855863 }
856864 $fname = $upload['tmp_name'];
857865 if( is_uploaded_file( $fname ) ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2301,7 +2301,8 @@
23022302 'importhistoryconflict' => 'Conflicting history revision exists (may have imported this page before)',
23032303 'importnosources' => 'No transwiki import sources have been defined and direct history uploads are disabled.',
23042304 'importnofile' => 'No import file was uploaded.',
2305 -'importuploaderror' => 'Upload of import file failed; perhaps the file is bigger than the allowed upload size.',
 2305+'importuploaderrorsize' => 'Upload of import file failed. The file is bigger than the allowed upload size.',
 2306+'importuploaderrorpartial' => 'Upload of import file failed. The file was only partially uploaded.',
23062307
23072308 # Import log
23082309 'importlogpage' => 'Import log',

Follow-up revisions

RevisionCommit summaryAuthorDate
r29221More explanatory messages shown when an upload error happens (in continuation...huji17:43, 3 January 2008

Status & tagging log