Эх сурвалжийг харах

Merge branch 'dev' into feature/mustache-spec

Justin Hileman 15 жил өмнө
parent
commit
7ffd232c2e
2 өөрчлөгдсөн 10 нэмэгдсэн , 15 устгасан
  1. 6 15
      Mustache.php
  2. 4 0
      test/phpunit.xml

+ 6 - 15
Mustache.php

@@ -475,21 +475,6 @@ class Mustache {
 	 */
 	protected function _renderTag($modifier, $tag_name) {
 		switch ($modifier) {
-			case '#':
-			case '^':
-				if ($this->_throwsException(MustacheException::UNCLOSED_SECTION)) {
-					throw new MustacheException('Unclosed section: ' . $tag_name, MustacheException::UNCLOSED_SECTION);
-				} else {
-					return '';
-				}
-				break;
-			case '/':
-				if ($this->_throwsException(MustacheException::UNEXPECTED_CLOSE_SECTION)) {
-					throw new MustacheException('Unexpected close section: ' . $tag_name, MustacheException::UNEXPECTED_CLOSE_SECTION);
-				} else {
-					return '';
-				}
-				break;
 			case '=':
 				return $this->_changeDelimiter($tag_name);
 				break;
@@ -508,6 +493,12 @@ class Mustache {
 					return $this->_renderUnescaped($tag_name);
 				}
 				break;
+			case '#':
+			case '^':
+			case '/':
+				// remove any leftovers from _renderSections
+				return '';
+				break;
 		}
 
 		if ($this->_hasPragma(self::PRAGMA_UNESCAPED)) {

+ 4 - 0
test/phpunit.xml

@@ -3,4 +3,8 @@
 	<testsuite name="Mustache">
 		<directory>./</directory>
 	</testsuite>
+	<blacklist>
+		<directory suffix=".php">../examples</directory>
+		<directory suffix=".php">./</directory>
+	</blacklist>
 </phpunit>