From 57b36d36c7e595bfb9d1bce3d0c28201ee5caeda Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 5 May 2010 23:54:17 +0000 Subject: [PATCH] fix logic error that spews warnings in r65905 --- maintenance/parserTests.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 2990944990..f01a46b001 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -298,7 +298,7 @@ class ParserTest { if ( $this->showProgress ) { print "\n"; } - return $ok; + return $ok; } /** @@ -352,7 +352,7 @@ class ParserTest { $noxml = isset( $opts['noxml'] ); $local = isset( $opts['local'] ); - $preprocessor = @$opts['preprocessor']; + $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null; $parser = $this->getParser( $preprocessor ); $title = Title::newFromText( $titleText ); @@ -1638,8 +1638,10 @@ class TestFileIterator implements Iterator { if( !isset( $data['article'] ) ) { wfDie( "'endarticle' without 'article' at line {$this->lineNum} of $filename\n" ); } - if( $this->parser ) $this->parser->addArticle($this->parser->chomp($data['article']), $this->parser->chomp($data['text']), - $this->lineNum); + if( $this->parser ) { + $this->parser->addArticle($this->parser->chomp($data['article']), $this->parser->chomp($data['text']), + $this->lineNum); + } $data = array(); $section = null; continue; @@ -1688,8 +1690,9 @@ class TestFileIterator implements Iterator { if (!isset( $data['config'] ) ) $data['config'] = ''; - if ( $this->parser && (preg_match('/\\bdisabled\\b/i', $data['options']) && !$this->parser->runDisabled) - || !preg_match("/{$this->parser->regex}/i", $data['test']) ) { + if ( $this->parser + && ((preg_match('/\\bdisabled\\b/i', $data['options']) && !$this->parser->runDisabled) + || !preg_match("/".$this->parser->regex."/i", $data['test'])) ) { # disabled test $data = array(); $section = null; -- 2.20.1