Follow-up r60175: Avoid PHP Notice: Undefined index: descriptionUrl in /var/www/w...
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 17 Dec 2009 22:54:55 +0000 (22:54 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 17 Dec 2009 22:54:55 +0000 (22:54 +0000)
includes/media/Bitmap.php

index ddbf33e..016933b 100644 (file)
@@ -60,7 +60,7 @@ class BitmapHandler extends ImageHandler {
                $physicalHeight = $params['physicalHeight'];
                $clientWidth = $params['width'];
                $clientHeight = $params['height'];
-               $descriptionUrl = $params['descriptionUrl'];
+               $descriptionUrl = isset( $params['descriptionUrl'] ) ? "File source: ". $params['descriptionUrl'] : '';
                $srcWidth = $image->getWidth();
                $srcHeight = $image->getHeight();
                $mimeType = $image->getMimeType();
@@ -155,7 +155,7 @@ class BitmapHandler extends ImageHandler {
                                // or ImageMagick may decide your ratio is wrong and slice off
                                // a pixel.
                                " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
-                               " -set comment " . wfEscapeShellArg( "File source: {$descriptionUrl}" ) .
+                               " -set comment " . wfEscapeShellArg( "{$descriptionUrl}" ) .
                                " -depth 8 $sharpen " .
                                wfEscapeShellArg($dstPath) . " 2>&1";
                        wfDebug( __METHOD__.": running ImageMagick: $cmd\n");