r20100 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20099‎ | r20100 | r20101 >
Date:15:33, 1 March 2007
Author:raymond
Status:old
Tags:
Comment:
* (bug 8728) MediaWiki:Badfiletype splitted into 3 messages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.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
@@ -746,7 +746,9 @@
747747 'minlength',
748748 'illegalfilename',
749749 'badfilename',
750 - 'badfiletype',
 750+ 'filetype-badtype',
 751+ 'filetype-badmime',
 752+ 'filetype-missing',
751753 'large-file',
752754 'largefileserver',
753755 'emptyfile',
Index: trunk/phase3/includes/SpecialUpload.php
@@ -347,10 +347,12 @@
348348 /* Don't allow users to override the blacklist (check file extension) */
349349 global $wgStrictFileExtensions;
350350 global $wgFileExtensions, $wgFileBlacklist;
351 - if( $this->checkFileExtensionList( $ext, $wgFileBlacklist ) ||
352 - ($wgStrictFileExtensions &&
353 - !$this->checkFileExtension( $finalExt, $wgFileExtensions ) ) ) {
354 - return $this->uploadError( wfMsgHtml( 'badfiletype', htmlspecialchars( $finalExt ) ) );
 351+ if ($finalExt == '') {
 352+ return $this->uploadError( wfMsgExt( 'filetype-missing', array ( 'parseinline' ) ) );
 353+ } elseif ( $this->checkFileExtensionList( $ext, $wgFileBlacklist ) ||
 354+ ($wgStrictFileExtensions &&
 355+ !$this->checkFileExtension( $finalExt, $wgFileExtensions ) ) ) {
 356+ return $this->uploadError( wfMsgExt( 'filetype-badtype', array ( 'parseinline' ), htmlspecialchars( $finalExt ), implode ( ', ', $wgFileExtensions ) ) );
355357 }
356358
357359 /**
@@ -393,7 +395,7 @@
394396 global $wgCheckFileExtensions;
395397 if ( $wgCheckFileExtensions ) {
396398 if ( ! $this->checkFileExtension( $finalExt, $wgFileExtensions ) ) {
397 - $warning .= '<li>'.wfMsgHtml( 'badfiletype', htmlspecialchars( $finalExt ) ).'</li>';
 399+ $warning .= '<li>'.wfMsgExt( 'filetype-badtype', array ( 'parseinline' ), htmlspecialchars( $finalExt ), implode ( ', ', $wgFileExtensions ) ).'</li>';
398400 }
399401 }
400402
@@ -927,7 +929,7 @@
928930 global $wgMimeTypeBlacklist;
929931 if( isset($wgMimeTypeBlacklist) && !is_null($wgMimeTypeBlacklist)
930932 && $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
931 - return new WikiErrorMsg( 'badfiletype', htmlspecialchars( $mime ) );
 933+ return new WikiErrorMsg( 'filetype-badmime', htmlspecialchars( $mime ) );
932934 }
933935 }
934936
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1326,7 +1326,10 @@
13271327 'minlength' => 'File names must be at least three letters.',
13281328 'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles. Please rename the file and try uploading it again.',
13291329 'badfilename' => 'File name has been changed to "$1".',
1330 -'badfiletype' => "\".$1\" is not a recommended image file format.",
 1330+'filetype-badmime' => 'Files of the MIME type "$1" are not allowed to be uploaded.',
 1331+'filetype-badtype' => "'''\".$1\"''' is an unwanted file type
 1332+: List of allowed file types: $2",
 1333+'filetype-missing' => 'The file has no extension (like ".jpg").',
13311334 'large-file' => 'It is recommended that files are no larger than $1; this file is $2.',
13321335 'largefileserver' => 'This file is bigger than the server is configured to allow.',
13331336 'emptyfile' => 'The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file.',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -941,7 +941,10 @@
942942 'minlength' => 'Dateinamen müssen mindestens drei Buchstaben lang sein.',
943943 'illegalfilename' => 'Der Dateiname „$1“ enthält mindestens ein nicht erlaubtes Zeichen. Bitte benennen Sie die Datei um und versuchen Sie diese erneut hochzuladen.',
944944 'badfilename' => 'Der Dateiname wurde in „$1“ geändert.',
945 -'badfiletype' => '„.$1“ ist kein empfohlenes Dateiformat.',
 945+'filetype-badmime' => 'Dateien mit dem MIME-Typ „$1“ dürfen nicht hochgeladen werden.',
 946+'filetype-badtype' => "'''„.$1“''' ist ein unerwünschtes Dateiformat.
 947+: Erlaubt sind: $2",
 948+'filetype-missing' => "Die hochzuladende Datei hat keine Erweiterung (z. B. „.jpg“).",
946949 'large-file' => 'Die Dateigröße sollte nach Möglichkeit $1 nicht überschreiten. Diese Datei ist $2 groß.',
947950 'largefileserver' => 'Die Datei ist größer als die vom Server eingestellte Maximalgröße.',
948951 'emptyfile' => 'Die hochgeladene Datei ist leer. Der Grund kann ein Tippfehler im Dateinamen sein. Bitte kontrollieren Sie, ob Sie die Datei wirklich hochladen wollen.',
Index: trunk/phase3/RELEASE-NOTES
@@ -242,6 +242,7 @@
243243 * (bug 3953) Work around poor display of parenthesis in the in other
244244 languages section of MonoBook skin
245245 * (bug 8539) Enable PLURAL option for another message of recentchanges.
 246+* (bug 8728) MediaWiki:Badfiletype splitted into 3 messages
246247
247248 == Languages updated ==
248249