http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73754
Revision: 73754
Author: platonides
Date: 2010-09-25 16:58:32 +0000 (Sat, 25 Sep 2010)
Log Message:
-----------
Revert r73587 and fix r62087 regression by providing the default value in
$comment definition.
This not only fixes the issue of line 189, but also the one at line 156.
Modified Paths:
--------------
trunk/phase3/maintenance/importImages.php
Modified: trunk/phase3/maintenance/importImages.php
===================================================================
--- trunk/phase3/maintenance/importImages.php 2010-09-25 16:56:03 UTC (rev
73753)
+++ trunk/phase3/maintenance/importImages.php 2010-09-25 16:58:32 UTC (rev
73754)
@@ -33,7 +33,7 @@
if ( isset( $options['protect'] ) && isset( $options['unprotect'] ) )
die( "Cannot specify both protect and unprotect. Only
1 is allowed.\n" );
-if ( isset( $options['protect'] ) && $options['protect'] == 1 )
+ if ( isset( $options['protect'] ) && $options['protect'] == 1 )
die( "You must specify a protection option.\n" );
# Prepare the list of allowed extensions
@@ -72,8 +72,8 @@
$limit = @$options['limit'];
if ( $limit ) $limit = (int)$limit;
- # Get the upload comment
- $comment = NULL;
+ # Get the upload comment. Provide a default one in case there's no
comment given.
+ $comment = 'Importing image file';
if ( isset( $options['comment-file'] ) ) {
$comment = file_get_contents( $options['comment-file'] );
@@ -186,7 +186,7 @@
}
if ( !$commentText ) {
- $commentText = $comment ? $comment :
'Importing image file';
+ $commentText = $comment;
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs