Fix Template class not recognizing extensions other than .html and .php

This commit is contained in:
Kijin Sung 2023-10-10 15:05:15 +09:00
parent 16572c4515
commit d46d25c69f

View file

@ -93,7 +93,7 @@ class Template
// Normalize the filename. Result will look like 'bar/example.html'
$filename = trim(strtr($filename, ['\\' => '/', '//' => '/']), '/');
$filename = preg_replace('/[\{\}\(\)\[\]<>\$\'"]/', '', $filename);
if (!preg_match('/\.(html?|php)$/', $filename))
if (!preg_match('/\.\w+$/', $filename) && !Storage::exists($this->absolute_dirname . $filename))
{
$filename .= '.html';
}