mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix nofilter tag option did not disable default modifier
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
05.10.2011
|
05.10.2011
|
||||||
- bugfix of problem introduced with r4342 by replacing strlen() with isset()
|
- bugfix of problem introduced with r4342 by replacing strlen() with isset()
|
||||||
- add environment configuration issue with mbstring.func_overload Smarty cannot compensate for (Issue #45)
|
- add environment configuration issue with mbstring.func_overload Smarty cannot compensate for (Issue #45)
|
||||||
|
- bugfix nofilter tag option did not disable default modifier
|
||||||
|
|
||||||
04.10.2011
|
04.10.2011
|
||||||
- bugfix assign() in plugins called in subtemplates did change value also in parent template
|
- bugfix assign() in plugins called in subtemplates did change value also in parent template
|
||||||
|
@@ -1,45 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Compile Print Expression
|
* Smarty Internal Plugin Compile Print Expression
|
||||||
*
|
*
|
||||||
* Compiles any tag which will output an expression or variable
|
* Compiles any tag which will output an expression or variable
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Compiler
|
* @subpackage Compiler
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Compile Print Expression Class
|
* Smarty Internal Plugin Compile Print Expression Class
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Compiler
|
* @subpackage Compiler
|
||||||
*/
|
*/
|
||||||
class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase {
|
class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attribute definition: Overwrites base class.
|
* Attribute definition: Overwrites base class.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @see Smarty_Internal_CompileBase
|
* @see Smarty_Internal_CompileBase
|
||||||
*/
|
*/
|
||||||
public $optional_attributes = array('assign');
|
public $optional_attributes = array('assign');
|
||||||
/**
|
/**
|
||||||
* Attribute definition: Overwrites base class.
|
* Attribute definition: Overwrites base class.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @see Smarty_Internal_CompileBase
|
* @see Smarty_Internal_CompileBase
|
||||||
*/
|
*/
|
||||||
public $option_flags = array('nocache', 'nofilter');
|
public $option_flags = array('nocache', 'nofilter');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiles code for gererting output from any expression
|
* Compiles code for gererting output from any expression
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param object $compiler compiler object
|
* @param object $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
* @param array $parameter array with compilation parameter
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
public function compile($args, $compiler, $parameter)
|
public function compile($args, $compiler, $parameter)
|
||||||
{
|
{
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
@@ -64,23 +64,23 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||||||
if (!empty($parameter['modifierlist'])) {
|
if (!empty($parameter['modifierlist'])) {
|
||||||
$output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], 'value' => $output));
|
$output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], 'value' => $output));
|
||||||
}
|
}
|
||||||
// default modifier
|
if (!$_attr['nofilter']) {
|
||||||
if (!empty($compiler->smarty->default_modifiers)) {
|
// default modifier
|
||||||
if (empty($compiler->default_modifier_list)) {
|
if (!empty($compiler->smarty->default_modifiers)) {
|
||||||
$modifierlist = array();
|
if (empty($compiler->default_modifier_list)) {
|
||||||
foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
|
$modifierlist = array();
|
||||||
preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
|
foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
|
||||||
for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {
|
preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
|
||||||
if ($mod_array[0][$i] != ':') {
|
for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {
|
||||||
$modifierlist[$key][] = $mod_array[0][$i];
|
if ($mod_array[0][$i] != ':') {
|
||||||
|
$modifierlist[$key][] = $mod_array[0][$i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$compiler->default_modifier_list = $modifierlist;
|
||||||
}
|
}
|
||||||
$compiler->default_modifier_list = $modifierlist;
|
$output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, 'value' => $output));
|
||||||
}
|
}
|
||||||
$output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, 'value' => $output));
|
|
||||||
}
|
|
||||||
if (!$_attr['nofilter']) {
|
|
||||||
// autoescape html
|
// autoescape html
|
||||||
if ($compiler->template->smarty->escape_html) {
|
if ($compiler->template->smarty->escape_html) {
|
||||||
$output = "htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET)";
|
$output = "htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET)";
|
||||||
@@ -127,11 +127,11 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $compiler compiler object
|
* @param object $compiler compiler object
|
||||||
* @param string $name name of variable filter
|
* @param string $name name of variable filter
|
||||||
* @param type $output embedded output
|
* @param type $output embedded output
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function compile_output_filter($compiler, $name, $output)
|
private function compile_output_filter($compiler, $name, $output)
|
||||||
{
|
{
|
||||||
$plugin_name = "smarty_variablefilter_{$name}";
|
$plugin_name = "smarty_variablefilter_{$name}";
|
||||||
|
Reference in New Issue
Block a user