Permalink
Browse files

Latte: added exception "unexpected </tag>"

  • Loading branch information...
1 parent b8ca5b8 commit 0bd65b1d1308e15a86acdd65d9e29bb383b2855c @dg dg committed Apr 15, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 Nette/Latte/Compiler.php
View
@@ -250,7 +250,13 @@ private function processHtmlTagBegin(Token $token)
if (!$htmlNode) {
$htmlNode = new HtmlNode($token->name);
}
- } while (strcasecmp($htmlNode->name, $token->name));
+ if (strcasecmp($htmlNode->name, $token->name) === 0) {
+ break;
+ }
+ if ($htmlNode->macroAttrs) {
+ throw new CompileException("Unexpected </$token->name>.", 0, $token->line);
+ }
+ } while (TRUE);
$this->htmlNodes[] = $htmlNode;
$htmlNode->closing = TRUE;
$htmlNode->offset = strlen($this->output);

0 comments on commit 0bd65b1

Please sign in to comment.