Fix path normalization problem

This commit is contained in:
Kijin Sung 2023-10-21 14:19:20 +09:00
parent 6085b82d19
commit fefd3dd895
8 changed files with 62 additions and 18 deletions

View file

@ -399,6 +399,11 @@ class TemplateParser_v2
$dir = '"' . (str_contains($m[1], '/') ? dirname($m[1]) : '') . '"';
$path = basename($m[1]);
}
if (preg_match('#^(.+)/([^/]+)$#', $path, $match))
{
$dir = '$this->normalizePath(' . $dir . ' . "' . $match[1] . '")';
$path = $match[2];
}
// Generate the code to create a new Template object and compile it.
$tpl = '<?php $__tpl = new \Rhymix\Framework\Template(' . $dir . ', "' . $path . '", "' . ($this->template->extension ?: 'auto') . '"); ';