소스 검색

Don\'t escape html from blocks, removing unneeded variable assigns

Dan Miller 11 년 전
부모
커밋
f4e992119e
1개의 변경된 파일3개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 5
      src/Mustache/Compiler.php

+ 3 - 5
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 = '