From d489407773fae89519584b64f9e951fca34335e4 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 20 Jun 2010 15:32:54 +0000 Subject: [PATCH] Check return value from wfMkdirParents() rather than proceeding and probably failing --- includes/filerepo/ForeignAPIRepo.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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? -- 2.20.1