mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
- remove ?>\n<?php and ?><?php sequences from compiled template
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
10/17/2009
|
||||||
|
- remove ?>\n<?php and ?><?php sequences from compiled template
|
||||||
|
|
||||||
10/15/2009
|
10/15/2009
|
||||||
- buxfix on assigning array elements inside templates
|
- buxfix on assigning array elements inside templates
|
||||||
- parser bugfix on array access
|
- parser bugfix on array access
|
||||||
|
@@ -34,7 +34,7 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
|
|||||||
if (isset($append)) {
|
if (isset($append)) {
|
||||||
$_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
|
$_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
|
||||||
}
|
}
|
||||||
$_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean(); ?>\n";
|
$_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean(); ?>";
|
||||||
return $_output;
|
return $_output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,8 +26,8 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
|
|||||||
$_attr = $this->_get_attributes($args);
|
$_attr = $this->_get_attributes($args);
|
||||||
|
|
||||||
// display debug template
|
// display debug template
|
||||||
$_output = "\$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty);";
|
$_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty); ?>";
|
||||||
return "<?php $_output ?>";
|
return $_output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase {
|
|||||||
$this->_open_tag('if');
|
$this->_open_tag('if');
|
||||||
if (is_array($args['if condition'])) {
|
if (is_array($args['if condition'])) {
|
||||||
$_output = " <?php if (!isset(\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;\n";
|
$_output = " <?php if (!isset(\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;\n";
|
||||||
$_output .= " if (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value']."): ?>";
|
$_output .= "if (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value']."): ?>";
|
||||||
return $_output;
|
return $_output;
|
||||||
} else {
|
} else {
|
||||||
return '<?php if (' . $args['if condition'] . '): ?>';
|
return '<?php if (' . $args['if condition'] . '): ?>';
|
||||||
|
@@ -138,7 +138,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
|
|||||||
} else {
|
} else {
|
||||||
if ($has_compiled_template) {
|
if ($has_compiled_template) {
|
||||||
$_output .= " \$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n";
|
$_output .= " \$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n";
|
||||||
$_output .= $compiled_tpl . "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>";;
|
$_output .= $compiled_tpl . "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>";
|
||||||
$_output .= "<?php \$_smarty_tpl = array_pop(\$_tpl_stack);?>";
|
$_output .= "<?php \$_smarty_tpl = array_pop(\$_tpl_stack);?>";
|
||||||
} else {
|
} else {
|
||||||
$_output .= " echo \$_template->fetch(); ?>";
|
$_output .= " echo \$_template->fetch(); ?>";
|
||||||
|
@@ -63,7 +63,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
|
|||||||
|
|
||||||
if (!$this->compile_error) {
|
if (!$this->compile_error) {
|
||||||
// return compiled code
|
// return compiled code
|
||||||
return $parser->retvalue;
|
return str_replace(array("?>\n<?php","?><?php"), '', $parser->retvalue);
|
||||||
} else {
|
} else {
|
||||||
// compilation error
|
// compilation error
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user