- bugfix function plugins called with assign attribute like {foo assign='bar'} did not output returned content because

because assumption was made that it was assigned to a variable https://github.com/smarty-php/smarty/issues/292
This commit is contained in:
uwetews
2016-09-15 03:23:04 +02:00
parent 424dca6d24
commit 58b6472d4f
4 changed files with 7 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
===== 3.1.31-dev ===== (xx.xx.xx) ===== 3.1.31-dev ===== (xx.xx.xx)
15.09.2016 15.09.2016
- bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291 - bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291
- bugfix function plugins called with assign attribute like {foo assign='bar'} did not output returned content because
because assumption was made that it was assigned to a variable https://github.com/smarty-php/smarty/issues/292
11.09.2016 11.09.2016
- improvement {math} misleading E_USER_WARNING messages when parameter value = null https://github.com/smarty-php/smarty/issues/288 - improvement {math} misleading E_USER_WARNING messages when parameter value = null https://github.com/smarty-php/smarty/issues/288

View File

@@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.31-dev/19'; const SMARTY_VERSION = '3.1.31-dev/20';
/** /**
* define variable scopes * define variable scopes

View File

@@ -67,8 +67,8 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
'value' => $output)); 'value' => $output));
} }
//Does tag create output //Does tag create output
$compiler->has_output = isset($_attr[ 'assign' ]) ? false : true; $compiler->has_output = true;
$output = "<?php " . ($compiler->has_output ? "echo " : '') . "{$output};?>\n"; $output = "<?php echo {$output};?>\n";
return $output; return $output;
} }
} }

View File

@@ -75,8 +75,8 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
'value' => $output)); 'value' => $output));
} }
//Does tag create output //Does tag create output
$compiler->has_output = isset($_attr[ 'assign' ]) ? false : true; $compiler->has_output = true;
$output = "<?php " . ($compiler->has_output ? "echo " : '') . "{$output};?>\n"; $output = "<?php echo {$output};?>\n";
return $output; return $output;
} }
} }