summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Extensions/Node/Trans.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-05 06:03:40 -0400
committerczaks <marcin@6irc.net>2013-08-05 06:03:40 -0400
commita84c4510fccfdc0cfb6f187633daea10dc70f326 (patch)
tree6077f5211196ae40cac0184bb7cc67b81d320b0b /inc/lib/Twig/Extensions/Node/Trans.php
parent33c7abf11f3a9b5c0964a2d7a25533c2849dbc78 (diff)
parenta8327c3a37fd22d2aa5d63061c9d3eaa30ae425a (diff)
Merge branch 'master' of github.com:vichan-devel/Tinyboard
Conflicts: js/post-hider.js
Diffstat (limited to 'inc/lib/Twig/Extensions/Node/Trans.php')
-rw-r--r--inc/lib/Twig/Extensions/Node/Trans.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/inc/lib/Twig/Extensions/Node/Trans.php b/inc/lib/Twig/Extensions/Node/Trans.php
index 18087e77..e7dc1ca8 100644
--- a/inc/lib/Twig/Extensions/Node/Trans.php
+++ b/inc/lib/Twig/Extensions/Node/Trans.php
@@ -94,22 +94,25 @@ class Twig_Extensions_Node_Trans extends Twig_Node
;
}
- $compiler->raw(');');
+ $compiler->raw(");\n");
}
}
protected function compileString(Twig_NodeInterface $body)
{
- if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant) {
+ if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) {
return array($body, array());
}
$vars = array();
-
if (count($body)) {
$msg = '';
foreach ($body as $node) {
+ if (get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) {
+ $node = $node->getNode(1);
+ }
+
if ($node instanceof Twig_Node_Print) {
$n = $node->getNode('expr');
while ($n instanceof Twig_Node_Expression_Filter) {
@@ -127,4 +130,4 @@ class Twig_Extensions_Node_Trans extends Twig_Node
return array(new Twig_Node(array(new Twig_Node_Expression_Constant(trim($msg), $body->getLine()))), $vars);
}
-}
+} \ No newline at end of file