Bladeren bron

Optimize dot notation check

Don't try to traverse dot notation unless there's a dot in the variable name.
Justin Hileman 15 jaren geleden
bovenliggende
commit
289cd023d4
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      Mustache.php

+ 1 - 1
Mustache.php

@@ -660,7 +660,7 @@ class Mustache {
 	 * @return string
 	 */
 	protected function _getVariable($tag_name) {
-		if ($this->_hasPragma(self::PRAGMA_DOT_NOTATION) && $tag_name != '.') {
+		if ($tag_name != '.' && strpos($tag_name, '.') !== false && $this->_hasPragma(self::PRAGMA_DOT_NOTATION)) {
 			$chunks = explode('.', $tag_name);
 			$first = array_shift($chunks);