From: Chad Horohoe Date: Fri, 5 Dec 2008 20:22:43 +0000 (+0000) Subject: Bow out more gracefully if we can't write to the file. We've already got the foreign... X-Git-Tag: 1.31.0-rc.0~44111 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=a1764b164c0caf7b660c3f9875a6196351c122f5;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index a6773e11ec..c1d2ce1504 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -133,7 +133,10 @@ class ForeignAPIRepo extends FileRepo { if ( !is_dir($wgUploadDirectory . '/' . $path) ) { wfMkdirParents($wgUploadDirectory . '/' . $path); } - + if ( !is_writable( $wgUploadDirectory . '/' . $path . $fileName ) ) { + wfDebug( __METHOD__ . " could not write to thumb path\n" ); + return $foreignUrl; + } $localUrl = $wgServer . $wgUploadPath . '/' . $path . $fileName; $thumb = Http::get( $foreignUrl ); # FIXME: Delete old thumbs that aren't being used. Maintenance script?