Fix the compiled template check.

This commit is contained in:
andrey
2001-01-19 14:36:52 +00:00
parent 53f0f57aab
commit f8aa8a7b58
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;