Index: branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php =================================================================== diff -u -r5745 -r5843 --- branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 5745) +++ branches/unlabeled/unlabeled-1.24.2/core/kernel/parser/template_parser.php (.../template_parser.php) (revision 5843) @@ -333,14 +333,23 @@ } } - function CheckDir($dir) + /** + * Recursive mkdir + * + * @param string $dir + * @param string $base_path base path to directory where folders should be created in + */ + function CheckDir($dir, $base_path = '') { if (file_exists($dir)) { return; } else { + // remove $base_path from beggining because it is already created during install + $dir = preg_replace('/^'.preg_quote($base_path.'/', '/').'/', '', $dir, 1); $segments = explode('/', $dir); - $cur_path = ''; + $cur_path = $base_path; + foreach ($segments as $segment) { // do not add leading / for windows paths (c:\...) $cur_path .= preg_match('/^[a-zA-Z]{1}:/', $segment) ? $segment : '/'.$segment; @@ -460,7 +469,7 @@ $fname = str_replace(FULL_PATH, FULL_PATH.'/kernel/cache', $fname); if (!defined('SAFE_MODE') || !SAFE_MODE) { - $this->CheckDir(dirname($fname)); + $this->CheckDir(dirname($fname), FULL_PATH.'/kernel/cache'); } $tname = $this->Application->TemplatesCache->GetRealFilename($this->TemplateName).'.tpl';