Skip to content

Commit

Permalink
- CurlyBracketsFilter: fixed </tag> parsing in <script>
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 4, 2009
1 parent 588552c commit a35ddcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Nette/Templates/Filters/CurlyBracketsFilter.php
Expand Up @@ -266,7 +266,7 @@ private function cbContent($matches)
}

} else { // </tag
if ($this->context === self::CONTEXT_TEXT || $this->context === self::CONTEXT_CDATA) {
if ($this->context === self::CONTEXT_TEXT || ($this->context === self::CONTEXT_CDATA && $this->tag === strtolower($matches[2]))) {
$this->context = self::CONTEXT_TAG;
$this->escape = 'TemplateHelpers::escapeHtml';
$this->tag = NULL;
Expand Down
2 changes: 2 additions & 0 deletions tests/Templates/ref/test.curlyBrackets.php.html
Expand Up @@ -53,6 +53,8 @@ <h1>Nette\Templates\CurlyBracketsFilter test</h1>

<script>
<!--
alert('</div>');

var prop = ["John","Mary","Paul"];

document.getElementById(":\/item").style.backgroundColor = 'red';
Expand Down
2 changes: 2 additions & 0 deletions tests/Templates/templates/curly-brackets.phtml
Expand Up @@ -52,6 +52,8 @@ comment *}

<script>
<!--
alert('</div>');

var prop = {$people};

document.getElementById({$id}).style.backgroundColor = 'red';
Expand Down

0 comments on commit a35ddcd

Please sign in to comment.