MDL-18200 - fix make_upload_directory() was always failing on initial creation of...
authorstronk7 <stronk7>
Wed, 11 Feb 2009 15:26:29 +0000 (15:26 +0000)
committerstronk7 <stronk7>
Wed, 11 Feb 2009 15:26:29 +0000 (15:26 +0000)
lib/setuplib.php

index d9873cb4641f4b6b7f3eb65ee13f2837b3e57d10..67be6bca669788d07c27b90362e9ac83207da0e3 100644 (file)
@@ -327,7 +327,7 @@ function make_upload_directory($directory, $shownotices=true) {
     umask(0000);
 
     if (!file_exists($currdir)) {
-        if (!is_writable($currdir) or !mkdir($currdir, $CFG->directorypermissions)) {
+        if (!mkdir($currdir, $CFG->directorypermissions) or !is_writable($currdir)) {
             if ($shownotices) {
                 echo '<div class="notifyproblem" align="center">ERROR: You need to create the directory '.
                      $currdir .' with web server write access</div>'."<br />\n";