Fixed a bug for a regular expression

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9262 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-09-22 01:49:52 +00:00
parent 5f66f744e1
commit 1d783a6dbf

View file

@ -281,11 +281,11 @@
function _parseInline($buff)
{
if(preg_match_all('/<([a-zA-Z0-9]+)[^>]*?(?:[ \|]cond| loop)="/s', $buff, $matches) === false) return $buff;
if(preg_match_all('/<([a-zA-Z0-9]+)(?:->|<!--.+?-->|[^<>-]*)*?(?:[ \|]cond| loop)="/s', $buff, $matches) === false) return $buff;
$tags = array_unique($matches[1]);
$tags = implode('|',array_unique($matches[1]));
$split_regex = '@(<(?:/(?:'.$tags.')|(?:'.$tags.')(?:[^>]*(?:cond|loop)="[^"]+")*)[^>]*>)@s';
$split_regex = '@(<(?:/(?:'.$tags.')|(?:'.$tags.')(?:(?:->|<!--.+?-->|[^<>])*?(?:cond|loop)="[^"]+")*)(?:->|<!--.+?-->|[^<>])*>)@s';
$nodes = preg_split($split_regex, $buff, -1, PREG_SPLIT_DELIM_CAPTURE);