diff options
author | xue <> | 2006-04-30 12:17:55 +0000 |
---|---|---|
committer | xue <> | 2006-04-30 12:17:55 +0000 |
commit | dafc1325d7bcd4e9593c010e4eb6c0261ed340e8 (patch) | |
tree | 767195a707f5e7c1ca371be38f4c132c95775935 /framework/Web | |
parent | 78451f23782b7c9d5464fdb8a4e25b6e5ac67ac6 (diff) |
Template comment tag is changed from <! ... !> to <!-- ... --!>
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index d92d4a36..078fa86d 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -146,7 +146,7 @@ class TTemplateManager extends TModule class TTemplate extends TApplicationComponent implements ITemplate
{
/**
- * '<!.*?!>' - template comments
+ * '<!--.*?--!>' - template comments
* '<!--.*?-->' - HTML comments
* '<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>' - component tags
* '<\/?prop:([\w\.]+)\s*>' - property tags
@@ -616,17 +616,17 @@ class TTemplate extends TApplicationComponent implements ITemplate $expectPropEnd=false;
}
}
- else if(strpos($str,'<!--')===0) // HTML comments
+ else if(strpos($str,'<!--')===0) // comments
{
- // do nothing
- }
- else if(strpos($str,'<!')===0) // template comments
- {
- if($expectPropEnd)
- throw new TConfigurationException('template_comments_forbidden');
- if($matchStart>$textStart)
- $tpl[$c++]=array($container,substr($input,$textStart,$matchStart-$textStart));
- $textStart=$matchEnd+1;
+ if(strrpos($str,'--!>')===strlen($str)-4) // template comments
+ {
+ if($expectPropEnd)
+ throw new TConfigurationException('template_comments_forbidden');
+ if($matchStart>$textStart)
+ $tpl[$c++]=array($container,substr($input,$textStart,$matchStart-$textStart));
+ $textStart=$matchEnd+1;
+ }
+ // else, HTML comments and we do nothing
}
else
throw new TConfigurationException('template_matching_unexpected',$match);
|