Fixed some bugs

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9283 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-09-22 13:12:19 +00:00
parent 5a027fbdf5
commit c41ca3184a

View file

@ -274,11 +274,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.').+?[ "\'])>)@s';
$nodes = preg_split($split_regex, $buff, -1, PREG_SPLIT_DELIM_CAPTURE);
@ -327,7 +327,7 @@
$depth = 1;
for($i=$idx+2; $i < $node_len; $i+=2) {
$nd = $nodes[$i];
if(strpos($nd, $tag.' ') === 1) {
if(strpos($nd, $tag) === 1) {
$depth++;
} elseif(strpos($nd, '/'.$tag) === 1) {
$depth--;