diff --git a/modules/cms/classes/CodeParser.php b/modules/cms/classes/CodeParser.php index 6d873d8de..13e8b2d07 100644 --- a/modules/cms/classes/CodeParser.php +++ b/modules/cms/classes/CodeParser.php @@ -1,5 +1,6 @@ $path])); } + File::chmod($path); + return $className; } @@ -317,8 +320,12 @@ class CodeParser $count = 0; $dir = dirname($path); - if (is_dir($dir) && !is_writable($dir)) { - throw new SystemException(Lang::get('system::lang.directory.create_fail', ['name'=>$dir])); + if (is_dir($dir)) { + if (!is_writable($dir)) { + throw new SystemException(Lang::get('system::lang.directory.create_fail', ['name'=>$dir])); + } + + return; } while (!is_dir($dir) && !@mkdir($dir, 0777, true)) { @@ -328,6 +335,8 @@ class CodeParser throw new SystemException(Lang::get('system::lang.directory.create_fail', ['name'=>$dir])); } } + + File::chmodRecursive($path); } }