diff options
author | xue <> | 2007-09-11 13:01:29 +0000 |
---|---|---|
committer | xue <> | 2007-09-11 13:01:29 +0000 |
commit | 7d6036d9736558e4f9241be87447e1c2321834b1 (patch) | |
tree | a90a7a12772ef66b5b09ccb8fd80b7352c5addc1 /framework/Web/Services/TPageService.php | |
parent | 269c9a0010c2495db961c185e83fd52b33b04d73 (diff) |
further enhancements to page matching.
Diffstat (limited to 'framework/Web/Services/TPageService.php')
-rw-r--r-- | framework/Web/Services/TPageService.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 8b7fb52d..fcbb961f 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -695,9 +695,19 @@ class TPageConfiguration extends TComponent foreach($pagesNode->getElementsByTagName('page') as $node)
{
$properties=$node->getAttributes();
- if(($id=$properties->remove('id'))===null)
+ $id=$properties->remove('id');
+ if(empty($id))
throw new TConfigurationException('pageserviceconf_page_invalid',$configPath);
- if(($configPagePath==='' && strcasecmp($id,$this->_pagePath)===0) || ($configPath!=='' && strcasecmp($configPagePath.'.'.$id,$this->_pagePath)===0))
+ $matching=false;
+ $id=($configPagePath==='')?$id:$configPagePath.'.'.$id;
+ if(strcasecmp($id,$this->_pagePath)===0)
+ $matching=true;
+ else if($id[strlen($id)-1]==='*') // try wildcard matching
+ {
+ $id=strtolower(substr($id,0,strlen($id)-1));
+ $matching=(strpos(strtolower($this->_pagePath),$pattern)===0);
+ }
+ if($matching)
$this->_properties=array_merge($this->_properties,$properties->toArray());
}
}
|