mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-04 22:47:21 +00:00
fixed CheckToStringNode implementation
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
* 1.38.4 (2019-XX-XX)
|
* 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.38.3 (2019-03-21)
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ use Twig\Node\Expression\AbstractExpression;
|
|||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class CheckToStringNode extends Node
|
class CheckToStringNode extends AbstractExpression
|
||||||
{
|
{
|
||||||
public function __construct(AbstractExpression $expr)
|
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"
|
||||||
@@ -34,7 +34,7 @@ class Twig_Tests_IntegrationTest extends IntegrationTestCase
|
|||||||
{
|
{
|
||||||
public function getExtensions()
|
public function getExtensions()
|
||||||
{
|
{
|
||||||
$policy = new SecurityPolicy([], [], [], [], []);
|
$policy = new SecurityPolicy([], [], [], [], ['dump']);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
new DebugExtension(),
|
new DebugExtension(),
|
||||||
|
|||||||
Reference in New Issue
Block a user