diff options
author | xue <> | 2006-09-09 11:31:07 +0000 |
---|---|---|
committer | xue <> | 2006-09-09 11:31:07 +0000 |
commit | 4259fae2b63ed274838956ffa675abd2eefc618b (patch) | |
tree | b9b1ec21771392ab3a8020205af1053591eba309 | |
parent | ac92df7958d7985062bd7f559a9041289bdf5a2f (diff) |
Fixed #366.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ Version 3.0.5 October 8, 2006 =============================== CHG: Ticket#358 - TFileUpload::saveAs() now returns false instead of exception when error (Qiang) +ENH: Ticket#366 - white spaces are now allowed around attribute names in template (Qiang) Version 3.0.4 September 4, 2006 =============================== diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 7051a8dc..264112fc 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -148,12 +148,12 @@ class TTemplate extends TApplicationComponent implements ITemplate /**
* '<!--.*?--!>' - template comments
* '<!--.*?-->' - HTML comments
- * '<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>' - component tags
+ * '<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>' - component tags
* '<\/?prop:([\w\.]+)\s*>' - property tags
- * '<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives
+ * '<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>' - directives
* '<%[%#~\\$=\\[](.*?)%>' - expressions
*/
- const REGEX_RULES='/<!--.*?--!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
+ const REGEX_RULES='/<!--.*?--!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
/**
* Different configurations of component property/event/attribute
@@ -739,7 +739,7 @@ class TTemplate extends TApplicationComponent implements ITemplate {
if($str==='')
return array();
- $pattern='/([\w\.]+)=(\'.*?\'|".*?"|<%.*?%>)/msS';
+ $pattern='/([\w\.]+)\s*=\s*(\'.*?\'|".*?"|<%.*?%>)/msS';
$attributes=array();
$n=preg_match_all($pattern,$str,$matches,PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
for($i=0;$i<$n;++$i)
|