r44260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44259‎ | r44260 | r44261 >
Date:20:22, 5 December 2008
Author:demon
Status:ok
Tags:
Comment:
Bow out more gracefully if we can't write to the file. We've already got the foreign thumb URL on hand, so just use that.
Modified paths:
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -133,7 +133,10 @@
134134 if ( !is_dir($wgUploadDirectory . '/' . $path) ) {
135135 wfMkdirParents($wgUploadDirectory . '/' . $path);
136136 }
137 -
 137+ if ( !is_writable( $wgUploadDirectory . '/' . $path . $fileName ) ) {
 138+ wfDebug( __METHOD__ . " could not write to thumb path\n" );
 139+ return $foreignUrl;
 140+ }
138141 $localUrl = $wgServer . $wgUploadPath . '/' . $path . $fileName;
139142 $thumb = Http::get( $foreignUrl );
140143 # FIXME: Delete old thumbs that aren't being used. Maintenance script?

Status & tagging log