From: Chad Horohoe Date: Sun, 20 Jun 2010 15:32:54 +0000 (+0000) Subject: Check return value from wfMkdirParents() rather than proceeding and probably failing X-Git-Tag: 1.31.0-rc.0~36450 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=d489407773fae89519584b64f9e951fca34335e4;p=lhc%2Fweb%2Fwiklou.git Check return value from wfMkdirParents() rather than proceeding and probably failing --- diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index dbfdab070e..da6d1555d1 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -204,7 +204,10 @@ class ForeignAPIRepo extends FileRepo { $fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) ); $path = 'thumb/' . $this->getHashPath( $name ) . $name . "/"; if ( !is_dir($wgUploadDirectory . '/' . $path) ) { - wfMkdirParents($wgUploadDirectory . '/' . $path); + if( !wfMkdirParents($wgUploadDirectory . '/' . $path) ) { + wfDebug( __METHOD__ . " could not create directory for thumb\n" ); + return $foreignUrl; + } } $localUrl = $wgServer . $wgUploadPath . '/' . $path . $fileName; # FIXME: Delete old thumbs that aren't being used. Maintenance script?