From f4e992119e7ce90aa1254d0defc0697c9421d58f Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Mon, 14 Apr 2014 19:51:42 +0000 Subject: [PATCH] Don\'t escape html from blocks, removing unneeded variable assigns --- src/Mustache/Compiler.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index dcc9469..db17d90 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -211,9 +211,9 @@ class Mustache_Compiler } const BLOCK_VAR = ' - $value = $this->resolveValue($context->%s(%s), $context, $indent); + $value = $this->resolveValue($context->findInBlock(%s), $context, $indent); if($value && !is_array($value) && !is_object($value)) { - $buffer .= %s; + $buffer .= $value; } else { %s } @@ -221,11 +221,9 @@ class Mustache_Compiler private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level) { - $method = 'findInBlock'; $id_str = var_export($id, true); - $value = $this->getEscape(); - return sprintf($this->prepare(self::BLOCK_VAR, $level), $method, $id_str, $value, $this->walk($nodes, 2)); + return sprintf($this->prepare(self::BLOCK_VAR, $level), $id_str, $this->walk($nodes, 2)); } const BLOCK_ARG = '