Index: trunk/phase3/maintenance/preprocessorFuzzTest.php |
— | — | @@ -190,10 +190,10 @@ |
191 | 191 | $wgUser->mFrom = 'name'; |
192 | 192 | $wgUser->ppfz_test = $this; |
193 | 193 | |
194 | | - $options = new ParserOptions; |
| 194 | + $options = ParserOptions::newFromUser( $wgUser ); |
195 | 195 | $options->setTemplateCallback( array( $this, 'templateHook' ) ); |
196 | 196 | $options->setTimestamp( wfTimestampNow() ); |
197 | | - $this->output = call_user_func( array( $wgParser, $this->entryPoint ), $this->mainText, $this->title->getPrefixedText(), $options ); |
| 197 | + $this->output = call_user_func( array( $wgParser, $this->entryPoint ), $this->mainText, $this->title, $options ); |
198 | 198 | return $this->output; |
199 | 199 | } |
200 | 200 | |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | } |
219 | 219 | |
220 | 220 | class PPFuzzUser extends User { |
221 | | - var $ppfz_test; |
| 221 | + var $ppfz_test, $mDataLoaded; |
222 | 222 | |
223 | 223 | function load() { |
224 | 224 | if ( $this->mDataLoaded ) { |
— | — | @@ -227,13 +227,13 @@ |
228 | 228 | $this->loadDefaults( $this->mName ); |
229 | 229 | } |
230 | 230 | |
231 | | - function getOption( $option, $defaultOverride = '' ) { |
| 231 | + function getOption( $oname, $defaultOverride = null, $ignoreHidden = false ) { |
232 | 232 | if ( $option === 'fancysig' ) { |
233 | 233 | return $this->ppfz_test->fancySig; |
234 | 234 | } elseif ( $option === 'nickname' ) { |
235 | 235 | return $this->ppfz_test->nickname; |
236 | 236 | } else { |
237 | | - return parent::getOption( $option, $defaultOverride ); |
| 237 | + return parent::getOption( $option, $defaultOverride, $ignoreHidden ); |
238 | 238 | } |
239 | 239 | } |
240 | 240 | } |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -5461,9 +5461,6 @@ |
5462 | 5462 | * @return string |
5463 | 5463 | */ |
5464 | 5464 | function testSrvus( $text, $title, ParserOptions $options, $outputType = self::OT_HTML ) { |
5465 | | - if ( !$title instanceof Title ) { |
5466 | | - $title = Title::newFromText( $title ); |
5467 | | - } |
5468 | 5465 | $this->startParse( $title, $options, $outputType, true ); |
5469 | 5466 | |
5470 | 5467 | $text = $this->replaceVariables( $text ); |
— | — | @@ -5473,17 +5470,10 @@ |
5474 | 5471 | } |
5475 | 5472 | |
5476 | 5473 | function testPst( $text, $title, $options ) { |
5477 | | - global $wgUser; |
5478 | | - if ( !$title instanceof Title ) { |
5479 | | - $title = Title::newFromText( $title ); |
5480 | | - } |
5481 | | - return $this->preSaveTransform( $text, $title, $wgUser, $options ); |
| 5474 | + return $this->preSaveTransform( $text, $title, $options->getUser(), $options ); |
5482 | 5475 | } |
5483 | 5476 | |
5484 | 5477 | function testPreprocess( $text, $title, $options ) { |
5485 | | - if ( !$title instanceof Title ) { |
5486 | | - $title = Title::newFromText( $title ); |
5487 | | - } |
5488 | 5478 | return $this->testSrvus( $text, $title, $options, self::OT_PREPROCESS ); |
5489 | 5479 | } |
5490 | 5480 | |