Explorar el Código

math is hard - check the bounds of a string properly when looking to see if a closing } exists

steve hace 11 años
padre
commit
40e86247ad
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/Mustache/Tokenizer.php

+ 1 - 1
src/Mustache/Tokenizer.php

@@ -163,7 +163,7 @@ class Mustache_Tokenizer
                         if ($this->tagType === self::T_UNESCAPED) {
                             // Clean up `{{{ tripleStache }}}` style tokens.
                             if ($this->ctag === '}}') {
-                                if (($i < $len + 1) && $text[$i+2] == '}') {
+                                if (($i+2 < $len) && $text[$i+2] == '}') {
                                     $i++;
                                 } else {
                                     $msg = sprintf(