From: Fabien Potencier Date: Sat, 1 Dec 2012 18:41:29 +0000 (+0100) Subject: removed uneeded condition (a filter node cannot be created if the filer does not... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=6810dbe8a7be204813a4397b1bddcfdb875fe2e2;p=web%2Fkonrad%2Ftwig.git removed uneeded condition (a filter node cannot be created if the filer does not exist) --- diff --git a/lib/Twig/NodeVisitor/Escaper.php b/lib/Twig/NodeVisitor/Escaper.php index cc9a58b..0d749fe 100644 --- a/lib/Twig/NodeVisitor/Escaper.php +++ b/lib/Twig/NodeVisitor/Escaper.php @@ -107,22 +107,18 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface { $name = $filter->getNode('filter')->getAttribute('value'); - if (false !== $f = $env->getFilter($name)) { - $type = $f->getPreEscape(); - if (null === $type) { - return $filter; - } - - $node = $filter->getNode('node'); - if ($this->isSafeFor($type, $node, $env)) { - return $filter; - } - - $filter->setNode('node', $this->getEscaperFilter($type, $node)); + $type = $env->getFilter($name)->getPreEscape(); + if (null === $type) { + return $filter; + } + $node = $filter->getNode('node'); + if ($this->isSafeFor($type, $node, $env)) { return $filter; } + $filter->setNode('node', $this->getEscaperFilter($type, $node)); + return $filter; }