mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed problem with newline at the end of compiled templates
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- fixed problem with newline at the end of included templates (Monte, Andrei)
|
||||||
- added feature to regenerate cache if compile_check is enabled and an
|
- added feature to regenerate cache if compile_check is enabled and an
|
||||||
involved template or config file gets modified (Monte)
|
involved template or config file gets modified (Monte)
|
||||||
- added DEBUG execution times to included files (Monte)
|
- added DEBUG execution times to included files (Monte)
|
||||||
|
@@ -198,7 +198,7 @@ class Smarty
|
|||||||
var $_compile_id = null; // for different compiled templates
|
var $_compile_id = null; // for different compiled templates
|
||||||
var $_smarty_debug_id = 'SMARTY_DEBUG'; // text in URL to enable debug mode
|
var $_smarty_debug_id = 'SMARTY_DEBUG'; // text in URL to enable debug mode
|
||||||
var $_smarty_debug_info = array(); // debugging information for debug console
|
var $_smarty_debug_info = array(); // debugging information for debug console
|
||||||
var $_cache_info = array(); // templates that make up a cache file
|
var $_cache_info = array(); // info that makes up a cache file
|
||||||
|
|
||||||
|
|
||||||
/*======================================================================*\
|
/*======================================================================*\
|
||||||
|
@@ -163,6 +163,10 @@ class Smarty_Compiler extends Smarty {
|
|||||||
$template_header .= " compiled from ".$tpl_file." */ ?>\n";
|
$template_header .= " compiled from ".$tpl_file." */ ?>\n";
|
||||||
$template_compiled = $template_header.$template_compiled;
|
$template_compiled = $template_header.$template_compiled;
|
||||||
|
|
||||||
|
// remove \n from the end of the file, if any
|
||||||
|
if ( $template_compiled{strlen($template_compiled)-1} == "\n" ) {
|
||||||
|
$template_compiled = substr($template_compiled,0,-1);
|
||||||
|
}
|
||||||
|
|
||||||
// run compiled template through postfilter functions
|
// run compiled template through postfilter functions
|
||||||
if (is_array($this->postfilter_funcs) && count($this->postfilter_funcs) > 0) {
|
if (is_array($this->postfilter_funcs) && count($this->postfilter_funcs) > 0) {
|
||||||
|
@@ -198,7 +198,7 @@ class Smarty
|
|||||||
var $_compile_id = null; // for different compiled templates
|
var $_compile_id = null; // for different compiled templates
|
||||||
var $_smarty_debug_id = 'SMARTY_DEBUG'; // text in URL to enable debug mode
|
var $_smarty_debug_id = 'SMARTY_DEBUG'; // text in URL to enable debug mode
|
||||||
var $_smarty_debug_info = array(); // debugging information for debug console
|
var $_smarty_debug_info = array(); // debugging information for debug console
|
||||||
var $_cache_info = array(); // templates that make up a cache file
|
var $_cache_info = array(); // info that makes up a cache file
|
||||||
|
|
||||||
|
|
||||||
/*======================================================================*\
|
/*======================================================================*\
|
||||||
|
@@ -163,6 +163,10 @@ class Smarty_Compiler extends Smarty {
|
|||||||
$template_header .= " compiled from ".$tpl_file." */ ?>\n";
|
$template_header .= " compiled from ".$tpl_file." */ ?>\n";
|
||||||
$template_compiled = $template_header.$template_compiled;
|
$template_compiled = $template_header.$template_compiled;
|
||||||
|
|
||||||
|
// remove \n from the end of the file, if any
|
||||||
|
if ( $template_compiled{strlen($template_compiled)-1} == "\n" ) {
|
||||||
|
$template_compiled = substr($template_compiled,0,-1);
|
||||||
|
}
|
||||||
|
|
||||||
// run compiled template through postfilter functions
|
// run compiled template through postfilter functions
|
||||||
if (is_array($this->postfilter_funcs) && count($this->postfilter_funcs) > 0) {
|
if (is_array($this->postfilter_funcs) && count($this->postfilter_funcs) > 0) {
|
||||||
|
Reference in New Issue
Block a user