r68321 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68320‎ | r68321 | r68322 >
Date:15:32, 20 June 2010
Author:demon
Status:ok
Tags:
Comment:
Check return value from wfMkdirParents() rather than proceeding and probably failing
Modified paths:
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -204,7 +204,10 @@
205205 $fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) );
206206 $path = 'thumb/' . $this->getHashPath( $name ) . $name . "/";
207207 if ( !is_dir($wgUploadDirectory . '/' . $path) ) {
208 - wfMkdirParents($wgUploadDirectory . '/' . $path);
 208+ if( !wfMkdirParents($wgUploadDirectory . '/' . $path) ) {
 209+ wfDebug( __METHOD__ . " could not create directory for thumb\n" );
 210+ return $foreignUrl;
 211+ }
209212 }
210213 $localUrl = $wgServer . $wgUploadPath . '/' . $path . $fileName;
211214 # FIXME: Delete old thumbs that aren't being used. Maintenance script?

Status & tagging log