Merge branch '1.x' into 2.x

* 1.x:
  fixed EscaperNodeVisitor
  fixed CS
This commit is contained in:
Fabien Potencier
2019-04-16 19:10:25 +02:00
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -207,7 +207,7 @@
* 1.39.1 (2019-XX-XX)
* n/a
* fixed EscaperNodeVisitor
* 1.39.0 (2019-04-16)
+1 -1
View File
@@ -107,7 +107,7 @@ final class EscaperNodeVisitor extends AbstractNodeVisitor
$expr2 = $this->escapeInlinePrintNode(new InlinePrint($expr2, $expr2->getTemplateLine()), $env, $type);
}
$expr3 = $expression->getNode('expr3');
if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2, $env, $type)) {
if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3, $env, $type)) {
$expr3 = $this->unwrapConditional($expr3, $env, $type);
} else {
$expr3 = $this->escapeInlinePrintNode(new InlinePrint($expr3, $expr3->getTemplateLine()), $env, $type);
@@ -23,12 +23,16 @@
{{ true ? (false ? "<br />" : someVar) : "\n" }}
{{ true ? (true ? someVar : "<br />") : "\n" }}
{{ true ? (false ? someVar : "<br />") : "\n" }}
{{ false ? "\n" : (true ? someVar : "<br />") }}
{{ false ? "\n" : (false ? someVar : "<br />") }}
6. Nested conditionals with a variable marked safe
{{ true ? (true ? "<br />" : someVar|raw) : "\n" }}
{{ true ? (false ? "<br />" : someVar|raw) : "\n" }}
{{ true ? (true ? someVar|raw : "<br />") : "\n" }}
{{ true ? (false ? someVar|raw : "<br />") : "\n" }}
{{ false ? "\n" : (true ? someVar|raw : "<br />") }}
{{ false ? "\n" : (false ? someVar|raw : "<br />") }}
7. Without then clause
{{ "<br />" ?: someVar }}
@@ -63,12 +67,16 @@ return ['someVar' => '<br />', 'someFalseVar' => false]
&lt;br /&gt;
&lt;br /&gt;
<br />
&lt;br /&gt;
<br />
6. Nested conditionals with a variable marked safe
<br />
<br />
<br />
<br />
<br />
<br />
7. Without then clause
<br />