Suppress PHP warnings on failure to create thumbnail subdirectories. This should...
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 8 May 2004 04:41:54 +0000 (04:41 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 8 May 2004 04:41:54 +0000 (04:41 +0000)
includes/GlobalFunctions.php

index d78d263..fd823d0 100644 (file)
@@ -430,12 +430,15 @@ function wfImageArchiveDir( $fname , $subdir="archive")
 
        $hash = md5( $fname );
        $oldumask = umask(0);
+       
+       # Suppress warning messages here; if the file itself can't
+       # be written we'll worry about it then.
        $archive = "{$wgUploadDirectory}/{$subdir}";
-       if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); }
+       if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); }
        $archive .= "/" . $hash{0};
-       if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); }
+       if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); }
        $archive .= "/" . substr( $hash, 0, 2 );
-       if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); }
+       if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); }
 
        umask( $oldumask );
        return $archive;