mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Fix the compiled template check.
This commit is contained in:
@@ -273,7 +273,7 @@ class Smarty
|
|||||||
{
|
{
|
||||||
if(preg_match("/^(.+)\/([^\/]+)$/", $filepath, $match)) {
|
if(preg_match("/^(.+)\/([^\/]+)$/", $filepath, $match)) {
|
||||||
$tpl_file_dir = $match[1];
|
$tpl_file_dir = $match[1];
|
||||||
$tpl_file_name = $match[2];
|
$tpl_file_name = $match[2] . ".php";
|
||||||
|
|
||||||
//assemble compile directory path
|
//assemble compile directory path
|
||||||
$compile_dir = preg_replace("/([\.\/]*[^\/]+)(.*)/","\\1".preg_quote($this->compile_dir_ext,"/")."\\2",$match[1]);
|
$compile_dir = preg_replace("/([\.\/]*[^\/]+)(.*)/","\\1".preg_quote($this->compile_dir_ext,"/")."\\2",$match[1]);
|
||||||
@@ -371,7 +371,7 @@ class Smarty
|
|||||||
$strip_tags_modified[$i], $compiled_contents, 1);
|
$strip_tags_modified[$i], $compiled_contents, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->_write_file($compilepath . ".php", $compiled_contents))
|
if(!$this->_write_file($compilepath, $compiled_contents))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -273,7 +273,7 @@ class Smarty
|
|||||||
{
|
{
|
||||||
if(preg_match("/^(.+)\/([^\/]+)$/", $filepath, $match)) {
|
if(preg_match("/^(.+)\/([^\/]+)$/", $filepath, $match)) {
|
||||||
$tpl_file_dir = $match[1];
|
$tpl_file_dir = $match[1];
|
||||||
$tpl_file_name = $match[2];
|
$tpl_file_name = $match[2] . ".php";
|
||||||
|
|
||||||
//assemble compile directory path
|
//assemble compile directory path
|
||||||
$compile_dir = preg_replace("/([\.\/]*[^\/]+)(.*)/","\\1".preg_quote($this->compile_dir_ext,"/")."\\2",$match[1]);
|
$compile_dir = preg_replace("/([\.\/]*[^\/]+)(.*)/","\\1".preg_quote($this->compile_dir_ext,"/")."\\2",$match[1]);
|
||||||
@@ -371,7 +371,7 @@ class Smarty
|
|||||||
$strip_tags_modified[$i], $compiled_contents, 1);
|
$strip_tags_modified[$i], $compiled_contents, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->_write_file($compilepath . ".php", $compiled_contents))
|
if(!$this->_write_file($compilepath, $compiled_contents))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user