Check if the path is writable before trying to mkdir().
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 14 Mar 2009 02:17:01 +0000 (02:17 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 14 Mar 2009 02:17:01 +0000 (02:17 +0000)
includes/GlobalFunctions.php

index 2605ad0..35d8f18 100644 (file)
@@ -2008,6 +2008,9 @@ function wfMkdirParents( $dir, $mode = null ) {
        if ( is_null( $mode ) )
                $mode = $wgDirectoryMode;
 
+       if ( !is_writable( $dir ) ) {
+               return false;
+       }
        return mkdir( $dir, $mode, true );  // PHP5 <3
 }