diff options
| -rw-r--r-- | HISTORY | 1 | ||||
| -rw-r--r-- | UPGRADE | 6 | ||||
| -rw-r--r-- | framework/Web/UI/TTemplateManager.php | 22 | 
3 files changed, 15 insertions, 14 deletions
| @@ -27,6 +27,7 @@ CHG: Build javascript without compression, only comments are removed. (Wei)  CHG: TDatePicker's date can be set using Date property, it value must be in same format as DateFormat, TimeStamp must be set as integer (wei)
  CHG: TSimpleDateFormatter::parse() now return an integer or null on parse error (Wei)
  CHG: TControl::createControls() is changed to public. (Qiang)
 +CHG: Template comment tag is changed from <! ... !> to <!-- ... --!> (Qiang)
  NEW: TListControlValidator (Wei)
  NEW: TClientScript (Wei)
 @@ -16,9 +16,9 @@ for both A and B.  Upgrading from v3.0.0 RC2
  -------------------------
 -There should be no PHP compatibility issues. Remember to clean up 'assets'
 -directory of your PRADO application as Javascript libraries were updated
 -and client-side validators rewritten.
 +- Template comment tag is changed from <! ... !> to <!-- ... --!>
 +- Remember to clean up 'assets' directory of your PRADO application
 +  as Javascript libraries were updated and client-side validators rewritten.
  Upgrading from v3.0.0 RC1
 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);
 | 
