From 13da19dbe5d419852b9d3de982e68f6d5883dd1e Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 29 Jun 2006 18:40:08 +0000 Subject: A minor performance tune-up. --- framework/Web/UI/TTemplateManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index a68e8762..1fde4acc 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -629,7 +629,7 @@ class TTemplate extends TApplicationComponent implements ITemplate if($matchStart>$textStart) { $value=substr($input,$textStart,$matchStart-$textStart); - if(strrpos($prop,'template')===strlen($prop)-8) + if(substr($prop,-8,8)==='template') $value=$this->parseTemplateProperty($value,$textStart); else $value=$this->parseAttribute($value); @@ -650,7 +650,7 @@ class TTemplate extends TApplicationComponent implements ITemplate } else if(strpos($str,'')===strlen($str)-4) // template comments + if(substr($str,-4,4)==='--!>') // template comments { if($expectPropEnd) throw new TConfigurationException('template_comments_forbidden'); @@ -748,7 +748,7 @@ class TTemplate extends TApplicationComponent implements ITemplate if(isset($attributes[$name])) throw new TConfigurationException('template_property_duplicated',$name); $value=$match[2][0]; - if(strrpos($name,'template')===strlen($name)-8) + if(substr($name,-8,8)==='template') { if($value[0]==='\'' || $value[0]==='"') $attributes[$name]=$this->parseTemplateProperty(substr($value,1,strlen($value)-2),$match[2][1]+1); -- cgit v1.2.3