Index: branches/5.2.x/core/kernel/nparser/ntags.php =================================================================== diff -u -N -r14244 -r14870 --- branches/5.2.x/core/kernel/nparser/ntags.php (.../ntags.php) (revision 14244) +++ branches/5.2.x/core/kernel/nparser/ntags.php (.../ntags.php) (revision 14870) @@ -1,6 +1,6 @@ AppendCheckCode($o, $tag); + + return $o; + } + + /** + * Adds check code to $o + * + * @param string $o + * @param Array $tag + * @return void + * @access protected + */ + protected function AppendCheckCode(&$o, $tag) + { $to_pass = $this->Parser->CompileParamsArray($tag['NP']); + $code = Array (); $code[] = "\$_splited = \$_parser->SplitTag(array('tag'=>\"{$tag['NP']['check']}\", 'file'=>'{$tag['file']}', 'line'=>{$tag['line']}));"; $code[] = 'if ($_splited[\'prefix\'] == \'__auto__\') {$_splited[\'prefix\'] = $PrefixSpecial;}'; $code[] = '$_p_ =& $_parser->GetProcessor($_splited[\'prefix\']);'; - if (isset($tag['NP']['inverse']) || $this->_Inversed) { + + if ( isset($tag['NP']['inverse']) || $this->_Inversed ) { $code[] = "if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {"; } else { $code[] = "if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {"; } + $this->AppendCode($o, $code); - return $o; } function PassThrough(&$tag) @@ -505,23 +522,11 @@ return ''; } - $to_pass = $this->Parser->CompileParamsArray($tag['NP']); - $this->_elseIfCount++; // add same count of closing brackets in closing tag $this->AppendCode($o, "} else {"); + $this->AppendCheckCode($o, $tag); - $code[] = "\$_splited = \$_parser->SplitTag(array('tag'=>\"{$tag['NP']['check']}\", 'file'=>'{$tag['file']}', 'line'=>{$tag['line']}));"; - $code[] = 'if ($_splited[\'prefix\'] == \'__auto__\') {$_splited[\'prefix\'] = $PrefixSpecial;}'; - $code[] = '$_p_ =& $_parser->GetProcessor($_splited[\'prefix\']);'; - if (isset($tag['NP']['inverse']) || $this->_Inversed) { - $code[] = "if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {"; - } - else { - $code[] = "if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {"; - } - $this->AppendCode($o, $code); - $tag['processed'] = true; } return $o;