From: Chad Horohoe Date: Sat, 14 Mar 2009 02:17:01 +0000 (+0000) Subject: Check if the path is writable before trying to mkdir(). X-Git-Tag: 1.31.0-rc.0~42492 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=49e97b4c41069d0b0ff332499ae8699527d339bd;p=lhc%2Fweb%2Fwiklou.git Check if the path is writable before trying to mkdir(). --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2605ad002f..35d8f18212 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 }