From: Platonides Date: Sat, 25 Sep 2010 16:58:32 +0000 (+0000) Subject: Revert r73587 and fix r62087 regression by providing the default value in $comment... X-Git-Tag: 1.31.0-rc.0~34796 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=75f35e9b558b589473d93cc53f86770346e36aaa;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 4712325f9d..de10e69d99 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -33,7 +33,7 @@ if ( count( $args ) > 0 ) { 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 @@ if ( isset( $options['protect'] ) && $options['protect'] == 1 ) $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 ( isset( $options['protect'] ) && $options['protect'] == 1 ) } if ( !$commentText ) { - $commentText = $comment ? $comment : 'Importing image file'; + $commentText = $comment; } }