Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -275,7 +275,7 @@ |
276 | 276 | wfProfileIn( __METHOD__ ); |
277 | 277 | wfProfileIn( $fname ); |
278 | 278 | |
279 | | - $this->startExternalParse( $title, $options, self::OT_HTML, $clearState ); |
| 279 | + $this->startParse( $title, $options, self::OT_HTML, $clearState ); |
280 | 280 | |
281 | 281 | $oldRevisionId = $this->mRevisionId; |
282 | 282 | $oldRevisionObject = $this->mRevisionObject; |
— | — | @@ -459,7 +459,7 @@ |
460 | 460 | */ |
461 | 461 | function preprocess( $text, Title $title, ParserOptions $options, $revid = null ) { |
462 | 462 | wfProfileIn( __METHOD__ ); |
463 | | - $this->startExternalParse( $title, $options, self::OT_PREPROCESS, true ); |
| 463 | + $this->startParse( $title, $options, self::OT_PREPROCESS, true ); |
464 | 464 | if ( $revid !== null ) { |
465 | 465 | $this->mRevisionId = $revid; |
466 | 466 | } |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | */ |
481 | 481 | public function getPreloadText( $text, Title $title, ParserOptions $options ) { |
482 | 482 | # Parser (re)initialisation |
483 | | - $this->startExternalParse( $title, $options, self::OT_PLAIN, true ); |
| 483 | + $this->startParse( $title, $options, self::OT_PLAIN, true ); |
484 | 484 | |
485 | 485 | $flags = PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES; |
486 | 486 | $dom = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION ); |
— | — | @@ -4038,7 +4038,7 @@ |
4039 | 4039 | * @return String: the altered wiki markup |
4040 | 4040 | */ |
4041 | 4041 | public function preSaveTransform( $text, Title $title, User $user, ParserOptions $options, $clearState = true ) { |
4042 | | - $this->startExternalParse( $title, $options, self::OT_WIKI, $clearState ); |
| 4042 | + $this->startParse( $title, $options, self::OT_WIKI, $clearState ); |
4043 | 4043 | $this->setUser( $user ); |
4044 | 4044 | |
4045 | 4045 | $pairs = array( |
— | — | @@ -4266,6 +4266,10 @@ |
4267 | 4267 | * so that an external function can call some class members with confidence |
4268 | 4268 | */ |
4269 | 4269 | public function startExternalParse( Title $title = null, ParserOptions $options, $outputType, $clearState = true ) { |
| 4270 | + $this->startParse( $title, $options, $outputType, $clearState ); |
| 4271 | + } |
| 4272 | + |
| 4273 | + private function startParse( Title $title = null, ParserOptions $options, $outputType, $clearState = true ) { |
4270 | 4274 | $this->setTitle( $title ); |
4271 | 4275 | $this->mOptions = $options; |
4272 | 4276 | $this->setOutputType( $outputType ); |
— | — | @@ -4881,7 +4885,7 @@ |
4882 | 4886 | */ |
4883 | 4887 | private function extractSections( $text, $section, $mode, $newText='' ) { |
4884 | 4888 | global $wgTitle; # not generally used but removes an ugly failure mode |
4885 | | - $this->startExternalParse( $wgTitle, new ParserOptions, self::OT_PLAIN, true ); |
| 4889 | + $this->startParse( $wgTitle, new ParserOptions, self::OT_PLAIN, true ); |
4886 | 4890 | $outText = ''; |
4887 | 4891 | $frame = $this->getPreprocessor()->newFrame(); |
4888 | 4892 | |
— | — | @@ -5176,7 +5180,7 @@ |
5177 | 5181 | if ( !$title instanceof Title ) { |
5178 | 5182 | $title = Title::newFromText( $title ); |
5179 | 5183 | } |
5180 | | - $this->startExternalParse( $title, $options, $outputType, true ); |
| 5184 | + $this->startParse( $title, $options, $outputType, true ); |
5181 | 5185 | |
5182 | 5186 | $text = $this->replaceVariables( $text ); |
5183 | 5187 | $text = $this->mStripState->unstripBoth( $text ); |