r49442 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49441‎ | r49442 | r49443 >
Date:15:05, 13 April 2009
Author:demon
Status:ok
Tags:
Comment:
If the file doesn't exist, we get a whole bunch of cascading PHP errors.
Modified paths:
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Bitmap.php
@@ -191,6 +191,12 @@
192192 return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
193193 }
194194
 195+ if ( !file_exists( $srcPath ) ) {
 196+ $err = "File seems to be missing: $srcPath";
 197+ wfDebug( "$err\n" );
 198+ return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
 199+ }
 200+
195201 $src_image = call_user_func( $loader, $srcPath );
196202 $dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight );
197203

Follow-up revisions

RevisionCommit summaryAuthorDate
r49516Follow up r49442: Make this new error message and two older error messages lo...raymond19:41, 15 April 2009

Status & tagging log