From 7d6036d9736558e4f9241be87447e1c2321834b1 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 11 Sep 2007 13:01:29 +0000 Subject: further enhancements to page matching. --- framework/Web/Services/TPageService.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'framework/Web/Services/TPageService.php') 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()); } } -- cgit v1.2.3