r73754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73753‎ | r73754 | r73755 >
Date:16:58, 25 September 2010
Author:platonides
Status:ok
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/phase3/maintenance/importImages.php
@@ -33,7 +33,7 @@
3434 if ( isset( $options['protect'] ) && isset( $options['unprotect'] ) )
3535 die( "Cannot specify both protect and unprotect. Only 1 is allowed.\n" );
3636
37 -if ( isset( $options['protect'] ) && $options['protect'] == 1 )
 37+ if ( isset( $options['protect'] ) && $options['protect'] == 1 )
3838 die( "You must specify a protection option.\n" );
3939
4040 # Prepare the list of allowed extensions
@@ -72,8 +72,8 @@
7373 $limit = @$options['limit'];
7474 if ( $limit ) $limit = (int)$limit;
7575
76 - # Get the upload comment
77 - $comment = NULL;
 76+ # Get the upload comment. Provide a default one in case there's no comment given.
 77+ $comment = 'Importing image file';
7878
7979 if ( isset( $options['comment-file'] ) ) {
8080 $comment = file_get_contents( $options['comment-file'] );
@@ -186,7 +186,7 @@
187187 }
188188
189189 if ( !$commentText ) {
190 - $commentText = $comment ? $comment : 'Importing image file';
 190+ $commentText = $comment;
191191 }
192192 }
193193

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62087Applied and tweaked smart-import patch from Mij, merging with 1.16....platonides16:10, 7 February 2010
r73587Fix regression caused by r62087 which failed to insert rows into the image ta...overlordq02:59, 23 September 2010

Status & tagging log