fixed CheckToStringNode implementation

This commit is contained in:
Fabien Potencier
2019-03-23 14:36:22 +01:00
parent deab8a7745
commit e24f796b83
4 changed files with 19 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
* 1.38.4 (2019-XX-XX)
* n/a
* fixed CheckToStringNode implementation (broken when a function/filter is variadic)
* 1.38.3 (2019-03-21)
+1 -1
View File
@@ -24,7 +24,7 @@ use Twig\Node\Expression\AbstractExpression;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class CheckToStringNode extends Node
class CheckToStringNode extends AbstractExpression
{
public function __construct(AbstractExpression $expr)
{
@@ -0,0 +1,16 @@
--TEST--
sandbox tag
--TEMPLATE--
{%- sandbox %}
{%- include "foo.twig" %}
{%- endsandbox %}
--TEMPLATE(foo.twig)--
{{ [a][0] }}
{{ dump([a][0]) }}
--DATA--
return ['a' => 'b']
--CONFIG--
return ['autoescape' => false, 'debug' => true]
--EXPECT--
b
string(1) "b"
+1 -1
View File
@@ -34,7 +34,7 @@ class Twig_Tests_IntegrationTest extends IntegrationTestCase
{
public function getExtensions()
{
$policy = new SecurityPolicy([], [], [], [], []);
$policy = new SecurityPolicy([], [], [], [], ['dump']);
return [
new DebugExtension(),