r113047 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113046‎ | r113047 | r113048 >
Date:17:09, 5 March 2012
Author:daniel
Status:deferred
Tags:
Comment:
replacing deprecated getText, etc
Modified paths:
  • /branches/Wikidata/phase3/includes/Article.php (modified) (history)
  • /branches/Wikidata/phase3/includes/Content.php (modified) (history)
  • /branches/Wikidata/phase3/includes/ContentHandler.php (modified) (history)
  • /branches/Wikidata/phase3/includes/EditPage.php (modified) (history)
  • /branches/Wikidata/phase3/includes/ImagePage.php (modified) (history)
  • /branches/Wikidata/phase3/includes/Revision.php (modified) (history)
  • /branches/Wikidata/phase3/includes/WikiPage.php (modified) (history)
  • /branches/Wikidata/phase3/includes/api/ApiEditPage.php (modified) (history)
  • /branches/Wikidata/phase3/includes/api/ApiParse.php (modified) (history)
  • /branches/Wikidata/phase3/includes/api/ApiPurge.php (modified) (history)
  • /branches/Wikidata/phase3/includes/resourceloader/ResourceLoaderWikiModule.php (modified) (history)
  • /branches/Wikidata/phase3/maintenance/populateRevisionLength.php (modified) (history)

Diff [purge]

Index: branches/Wikidata/phase3/maintenance/populateRevisionLength.php
@@ -67,7 +67,7 @@
6868 # Go through and update rev_len from these rows.
6969 foreach ( $res as $row ) {
7070 $rev = new Revision( $row );
71 - $text = $rev->getRawText();
 71+ $text = $rev->getRawText(); #FIXME: go via Content object; #FIXME: get size via Content object
7272 if ( !is_string( $text ) ) {
7373 # This should not happen, but sometimes does (bug 20757)
7474 $this->output( "Text of revision {$row->rev_id} unavailable!\n" );
Index: branches/Wikidata/phase3/includes/Article.php
@@ -37,7 +37,7 @@
3838 */
3939 public $mParserOptions;
4040
41 - var $mContent; // !< #FIXME: use Content object!
 41+ var $mContent; // !< #BC cruft
4242 var $mContentObject; // !<
4343 var $mContentLoaded = false; // !<
4444 var $mOldId; // !<
@@ -192,7 +192,7 @@
193193 * @return Return the text of this revision
194194 * @deprecated in 1.20; use getContentObject() instead
195195 */
196 - public function getContent() { #FIXME: deprecated! replace usage! use content object!
 196+ public function getContent() {
197197 wfDeprecated( __METHOD__, '1.20' );
198198 $content = $this->getContentObject();
199199 return ContentHandler::getContentText( $content );
@@ -226,7 +226,7 @@
227227 }
228228 wfProfileOut( __METHOD__ );
229229
230 - return new WikitextContent( $text, $this->getTitle() );
 230+ return ContentHandler::makeContent( $text, $this->getTitle() );
231231 } else {
232232 $this->fetchContentObject();
233233 wfProfileOut( __METHOD__ );
@@ -312,7 +312,7 @@
313313 * @return mixed string containing article contents, or false if null
314314 * @deprecated in 1.20, use getContentObject() instead
315315 */
316 - function fetchContent() { #BC cruft! #FIXME: deprecated, replace usage
 316+ protected function fetchContent() { #BC cruft!
317317 wfDeprecated( __METHOD__, '1.20' );
318318
319319 if ( $this->mContentLoaded && $this->mContent ) {
@@ -338,7 +338,7 @@
339339 *
340340 * @return Content object containing article contents, or null
341341 */
342 - function fetchContentObject() {
 342+ protected function fetchContentObject() {
343343 if ( $this->mContentLoaded ) {
344344 return $this->mContentObject;
345345 }
@@ -423,7 +423,7 @@
424424 * @return Revision|null
425425 */
426426 public function getRevisionFetched() {
427 - $this->fetchContent();
 427+ $this->fetchContentObject();
428428
429429 return $this->mRevision;
430430 }
@@ -582,7 +582,7 @@
583583 break;
584584 case 3:
585585 # This will set $this->mRevision if needed
586 - $this->fetchContent();
 586+ $this->fetchContentObject();
587587
588588 # Are we looking at an old revision
589589 if ( $oldid && $this->mRevision ) {
@@ -603,7 +603,7 @@
604604
605605 # Pages containing custom CSS or JavaScript get special treatment
606606 if ( $this->getTitle()->isCssOrJsPage() || $this->getTitle()->isCssJsSubpage() ) {
607 - #FIXME: use Content object instead!
 607+ #FIXME: use ContentHandler for specialized actions insetad.
608608 wfDebug( __METHOD__ . ": showing CSS/JS source\n" );
609609 $this->showCssOrJsPage();
610610 $outputDone = true;
@@ -611,14 +611,14 @@
612612 # Allow extensions do their own custom view for certain pages
613613 $outputDone = true;
614614 } else {
615 - $text = $this->getContent();
616 - $rt = Title::newFromRedirectArray( $text );
 615+ $content = $this->getContentObject();
 616+ $rt = $content->getRedirectChain();
617617 if ( $rt ) {
618618 wfDebug( __METHOD__ . ": showing redirect=no page\n" );
619619 # Viewing a redirect page (e.g. with parameter redirect=no)
620620 $wgOut->addHTML( $this->viewRedirect( $rt ) );
621621 # Parse just to get categories, displaytitle, etc.
622 - $this->mParserOutput = $wgParser->parse( $text, $this->getTitle(), $parserOptions );
 622+ $this->mParserOutput = $content->getParserOutput( $parserOptions );
623623 $wgOut->addParserOutputNoText( $this->mParserOutput );
624624 $outputDone = true;
625625 }
@@ -629,7 +629,7 @@
630630 wfDebug( __METHOD__ . ": doing uncached parse\n" );
631631
632632 $poolArticleView = new PoolWorkArticleView( $this, $parserOptions,
633 - $this->getRevIdFetched(), $useParserCache, $this->getContent() );
 633+ $this->getRevIdFetched(), $useParserCache, $this->getContentObject() );
634634
635635 if ( !$poolArticleView->execute() ) {
636636 $error = $poolArticleView->getError();
@@ -741,24 +741,18 @@
742742 * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these
743743 * page views.
744744 */
745 - protected function showCssOrJsPage() { #FIXME: deprecate, keep for BC
 745+ protected function showCssOrJsPage() { #FIXME: move this to handler!
746746 global $wgOut;
747747
748748 $dir = $this->getContext()->getLanguage()->getDir();
749749 $lang = $this->getContext()->getLanguage()->getCode();
750750
751751 $wgOut->wrapWikiMsg( "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",
752 - 'clearyourcache' ); #FIXME: get this from handler
 752+ 'clearyourcache' ); #FIXME: do this in handler
753753
754754 // Give hooks a chance to customise the output
755755 if ( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->getTitle(), $wgOut ) ) ) {
756 - #FIXME: use content object instead
757 - // Wrap the whole lot in a <pre> and don't parse
758 - $m = array();
759 - preg_match( '!\.(css|js)$!u', $this->getTitle()->getText(), $m );
760 - $wgOut->addHTML( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
761 - $wgOut->addHTML( htmlspecialchars( $this->mContent ) );
762 - $wgOut->addHTML( "\n</pre>\n" );
 756+ $wgOut->addHTML( $this->mContentObject->getHTML() );
763757 }
764758 }
765759
Index: branches/Wikidata/phase3/includes/Content.php
@@ -6,7 +6,7 @@
77 */
88 abstract class Content {
99
10 - public function __construct( Title $title, $revId, $modelName ) {
 10+ public function __construct( Title $title, $revId, $modelName ) { #FIXME: really need revId? annoying! #FIXME: really $title? or just when parsing, every time?
1111 $this->mModelName = $modelName;
1212 $this->mTitle = $title;
1313 $this->mRevId = $revId;
@@ -43,6 +43,14 @@
4444 return $update;
4545 }
4646
 47+ public function getRedirectChain() {
 48+ return null;
 49+ }
 50+
 51+ public function getSection( $section ) { #FIXME: should this return text? or a Content object? or what??
 52+ return null;
 53+ }
 54+
4755 #XXX: is the native model for wikitext a string or the parser output? parse early or parse late?
4856 }
4957
@@ -90,6 +98,11 @@
9199 return $text;
92100 }
93101
 102+ public function getRedirectChain() {
 103+ #XXX: really do this for all text, or just in WikitextContent
 104+ $text = $this->getRawData();
 105+ return Title::newFromRedirectArray( $text );
 106+ }
94107 }
95108
96109 class WikitextContent extends TextContent {
@@ -121,11 +134,18 @@
122135 $options = $this->getDefaultParserOptions();
123136 }
124137
125 - $po = $wgParser->parse( $this->mText, $this->getTitle(), $options );
 138+ $po = $wgParser->parse( $this->mText, $this->getTitle(), $options, true, true, $this->mRevId );
126139
127140 return $po;
128141 }
129142
 143+ public function getSection( $section ) {
 144+ global $wgParser;
 145+
 146+ $text = $this->getRawData();
 147+ return $wgParser->getSection( $text, $section, false );
 148+ }
 149+
130150 }
131151
132152 class MessageContent extends TextContent {
Index: branches/Wikidata/phase3/includes/ImagePage.php
@@ -245,20 +245,20 @@
246246 return $r;
247247 }
248248
249 - /**
250 - * Overloading Article's getContent method.
251 - *
252 - * Omit noarticletext if sharedupload; text will be fetched from the
253 - * shared upload server if possible.
254 - * @return string
255 - */
256 - public function getContent() {
257 - $this->loadFile();
258 - if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
259 - return '';
260 - }
261 - return parent::getContent();
262 - }
 249+ /**
 250+ * Overloading Article's getContentObject method.
 251+ *
 252+ * Omit noarticletext if sharedupload; text will be fetched from the
 253+ * shared upload server if possible.
 254+ * @return string
 255+ */
 256+ public function getContentObject() {
 257+ $this->loadFile();
 258+ if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
 259+ return null;
 260+ }
 261+ return parent::getContentObject();
 262+ }
263263
264264 protected function openShowImage() {
265265 global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
Index: branches/Wikidata/phase3/includes/ContentHandler.php
@@ -25,6 +25,13 @@
2626 return null;
2727 }
2828
 29+ public static function makeContent( $text, Title $title, $format = null, $revId = null ) {
 30+ $handler = ContentHandler::getForTitle( $title );
 31+
 32+ #FIXME: pass revid?
 33+ return $handler->unserialize( $text, $title, $format );
 34+ }
 35+
2936 public static function getDefaultModelFor( Title $title ) {
3037 global $wgNamespaceContentModels;
3138
@@ -130,33 +137,15 @@
131138 return $this->mSupportedFormats[0];
132139 }
133140
134 - public abstract function serialize( $obj, $format = null );
 141+ public abstract function serialize( $obj, Title $title, $format = null );
135142 # for wikitext, do nothing (in the future: serialise ast/dom)
136143 # for wikidata: serialize arrays to json
137144
138 - public abstract function unserialize( $blob, $format = null );
 145+ public abstract function unserialize( $blob, Title $title, $format = null ); #FIXME: ...and revId?
139146 # for wikitext, do nothing (in the future: parse into ast/dom)
140147 # for wikidata: serialize arrays to json
141148
142149
143 - public function getSearchText( $obj ) {
144 - # for wikitext, return wikitext
145 - # for wikidata, return pseudo-wikitext composed of property values (or some such)
146 - $text = $this->serialize( $obj );
147 - return $text; # return the default serialization.
148 - }
149 -
150 - public function getWikitextForTransclusion( $obj ) {
151 - # for wikitext, return text
152 - # for wikidata, return false, or some generated wikitext
153 - $text = $this->serialize( $obj );
154 - return '<pre>' . $text . '</pre>'; # return a pre-formatted block containing the default serialization.
155 - }
156 -
157 - public abstract function render( $obj, Title $title, ParserOptions $options, $revid = null );
158 - # returns a ParserOutput instance!
159 - # are parser options, generic?!
160 -
161150 public abstract function doPreSaveTransform( $title, $obj );
162151
163152 # TODO: getPreloadText()
Index: branches/Wikidata/phase3/includes/EditPage.php
@@ -864,7 +864,9 @@
865865 if ( $revision === null ) {
866866 return '';
867867 }
868 - return $this->mArticle->getContent();
 868+
 869+ $content = $this->mArticle->getContentObject();
 870+ return $content->getRawData(); # this editor is for editing the raw text. so use the raw text.
869871 }
870872
871873 /**
@@ -900,7 +902,7 @@
901903 * @param $preload String: representing the title to preload from.
902904 * @return String
903905 */
904 - protected function getPreloadedText( $preload ) {
 906+ protected function getPreloadedText( $preload ) { #FIXME: change to getPreloadedContent()
905907 global $wgUser, $wgParser;
906908
907909 if ( !empty( $this->mPreloadText ) ) {
@@ -928,7 +930,7 @@
929931 }
930932
931933 $parserOptions = ParserOptions::newFromUser( $wgUser );
932 - return $wgParser->getPreloadText( $page->getRawText(), $title, $parserOptions );
 934+ return $wgParser->getPreloadText( $page->getRawText(), $title, $parserOptions ); #FIXME: create Content::getPreloadCopy
933935 }
934936
935937 /**
Index: branches/Wikidata/phase3/includes/api/ApiParse.php
@@ -320,7 +320,7 @@
321321
322322 if ( $this->section !== false ) {
323323 $this->text = $this->getSectionText( $page->getRawText(), !is_null( $pageId )
324 - ? 'page id ' . $pageId : $titleObj->getText() );
 324+ ? 'page id ' . $pageId : $titleObj->getText() ); #FIXME: get section...
325325
326326 // Not cached (save or load)
327327 return $wgParser->parse( $this->text, $titleObj, $popts );
@@ -329,7 +329,8 @@
330330 // getParserOutput will save to Parser cache if able
331331 $pout = $page->getParserOutput( $popts );
332332 if ( $getWikitext ) {
333 - $this->text = $page->getRawText();
 333+ $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere
 334+ $this->text = $this->content->getRawData(); #FIXME: change $this->text to $this->data?!
334335 }
335336 return $pout;
336337 }
Index: branches/Wikidata/phase3/includes/api/ApiPurge.php
@@ -90,7 +90,7 @@
9191
9292 $popts = ParserOptions::newFromContext( $this->getContext() );
9393 $p_result = $wgParser->parse( $page->getRawText(), $title, $popts,
94 - true, true, $page->getLatest() );
 94+ true, true, $page->getLatest() ); #FIXME: content!
9595
9696 # Update the links tables
9797 $u = new LinksUpdate( $title, $p_result );
Index: branches/Wikidata/phase3/includes/api/ApiEditPage.php
@@ -108,21 +108,22 @@
109109 // We do want getContent()'s behavior for non-existent
110110 // MediaWiki: pages, though
111111 if ( $articleObj->getID() == 0 && $titleObj->getNamespace() != NS_MEDIAWIKI ) {
112 - $content = '';
 112+ $content = null;
 113+ $text = '';
113114 } else {
114 - $content = $articleObj->getContent();
 115+ $content = $articleObj->getContentObject();
 116+ $text = $content->getRawData();
115117 }
116118
117119 if ( !is_null( $params['section'] ) ) {
118120 // Process the content for section edits
119 - global $wgParser;
120121 $section = intval( $params['section'] );
121 - $content = $wgParser->getSection( $content, $section, false );
122 - if ( $content === false ) {
 122+ $text = $content->getSection( $section, false );
 123+ if ( $text === false || $text === null ) {
123124 $this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
124125 }
125126 }
126 - $params['text'] = $params['prependtext'] . $content . $params['appendtext'];
 127+ $params['text'] = $params['prependtext'] . $text . $params['appendtext'];
127128 $toMD5 = $params['prependtext'] . $params['appendtext'];
128129 }
129130
Index: branches/Wikidata/phase3/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -80,7 +80,7 @@
8181 if ( !$revision ) {
8282 return null;
8383 }
84 - return $revision->getRawText();
 84+ return $revision->getRawText(); #FIXME: get raw data from content object after checking the type;
8585 }
8686
8787 /* Methods */
Index: branches/Wikidata/phase3/includes/Revision.php
@@ -496,7 +496,7 @@
497497 $this->mCurrent = false;
498498 # If we still have no length, see it we have the text to figure it out
499499 if ( !$this->mSize ) {
500 - $this->mSize = is_null( $this->mText ) ? null : strlen( $this->mText );
 500+ $this->mSize = is_null( $this->mText ) ? null : strlen( $this->mText ); #FIXME: do strlen in Content object
501501 }
502502 # Same for sha1
503503 if ( $this->mSha1 === null ) {
@@ -779,7 +779,7 @@
780780 * @return String
781781 * @deprectaed in 1.20, use getContent() instead
782782 */
783 - public function getText( $audience = self::FOR_PUBLIC, User $user = null ) { #FIXME: deprecated, replace usage!
 783+ public function getText( $audience = self::FOR_PUBLIC, User $user = null ) { #FIXME: deprecated, replace usage! #FIXME: used a LOT!
784784 wfDeprecated( __METHOD__, '1.20' );
785785
786786 $content = $this->getContent();
Index: branches/Wikidata/phase3/includes/WikiPage.php
@@ -429,6 +429,11 @@
430430 return $this->getText( Revision::RAW );
431431 }
432432
 433+ protected function getRawData() {
 434+ $content = $this->getContent( Revision::RAW );
 435+ return $content->getRawData();
 436+ }
 437+
433438 /**
434439 * @return string MW timestamp of last article revision
435440 */
@@ -542,7 +547,7 @@
543548 * if false, the current database state will be used
544549 * @return Boolean
545550 */
546 - public function isCountable( $editInfo = false ) {
 551+ public function isCountable( $editInfo = false ) { #FIXME: move this to Content object
547552 global $wgArticleCountMethod;
548553
549554 if ( !$this->mTitle->isContentPage() ) {
@@ -620,7 +625,7 @@
621626 */
622627 public function insertRedirect() {
623628 // recurse through to only get the final target
624 - $retval = Title::newFromRedirectRecurse( $this->getRawText() );
 629+ $retval = Title::newFromRedirectRecurse( $this->getRawText() ); #FIXME: move this to Content object
625630 if ( !$retval ) {
626631 return null;
627632 }
@@ -904,7 +909,7 @@
905910
906911 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
907912 if ( $this->mTitle->exists() ) {
908 - $text = $this->getRawText();
 913+ $text = $this->getRawData();
909914 } else {
910915 $text = false;
911916 }
@@ -1093,7 +1098,7 @@
10941099 * @param $undoafter Revision Must be an earlier revision than $undo
10951100 * @return mixed string on success, false on failure
10961101 */
1097 - public function getUndoText( Revision $undo, Revision $undoafter = null ) {
 1102+ public function getUndoText( Revision $undo, Revision $undoafter = null ) { #FIXME: move undo logic to ContentHandler
10981103 $cur_text = $this->getRawText();
10991104 if ( $cur_text === false ) {
11001105 return false; // no page
@@ -1122,7 +1127,7 @@
11231128 * @param $edittime String: revision timestamp or null to use the current revision
11241129 * @return string Complete article text, or null if error
11251130 */
1126 - public function replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) {
 1131+ public function replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) { #FIXME: move to Content object!
11271132 wfProfileIn( __METHOD__ );
11281133
11291134 if ( strval( $section ) == '' ) {
@@ -1233,7 +1238,7 @@
12341239 *
12351240 * Compatibility note: this function previously returned a boolean value indicating success/failure
12361241 */
1237 - public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
 1242+ public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) { #FIXME: change $text to $content
12381243 global $wgUser, $wgDBtransactions, $wgUseAutomaticEditSummaries;
12391244
12401245 # Low-level sanity check
@@ -1268,7 +1273,7 @@
12691274 $isminor = ( $flags & EDIT_MINOR ) && $user->isAllowed( 'minoredit' );
12701275 $bot = $flags & EDIT_FORCE_BOT;
12711276
1272 - $oldtext = $this->getRawText(); // current revision
 1277+ $oldtext = $this->getRawData(); // current revision
12731278 $oldsize = strlen( $oldtext );
12741279 $oldid = $this->getLatest();
12751280 $oldIsRedirect = $this->isRedirect();
@@ -1276,7 +1281,7 @@
12771282
12781283 # Provide autosummaries if one is not provided and autosummaries are enabled.
12791284 if ( $wgUseAutomaticEditSummaries && $flags & EDIT_AUTOSUMMARY && $summary == '' ) {
1280 - $summary = self::getAutosummary( $oldtext, $text, $flags );
 1285+ $summary = self::getAutosummary( $oldtext, $text, $flags ); #FIXME: auto-summary from ContentHandler
12811286 }
12821287
12831288 $editInfo = $this->prepareTextForEdit( $text, null, $user );
@@ -1309,7 +1314,7 @@
13101315 'page' => $this->getId(),
13111316 'comment' => $summary,
13121317 'minor_edit' => $isminor,
1313 - 'text' => $text, #FIXME: set content instead, leavfe serialization to revision?!
 1318+ 'text' => $text, #FIXME: set content instead, leave serialization to revision?!
13141319 'parent_id' => $oldid,
13151320 'user' => $user->getId(),
13161321 'user_text' => $user->getName(),
@@ -1512,7 +1517,7 @@
15131518 $edit->pst = $wgParser->preSaveTransform( $text, $this->mTitle, $user, $popts );
15141519 $edit->popts = $this->makeParserOptions( 'canonical' );
15151520 $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid );
1516 - $edit->oldText = $this->getRawText();
 1521+ $edit->oldText = $this->getRawText(); #FIXME: $oldcontent instead?!
15171522
15181523 $this->mPreparedEdit = $edit;
15191524
@@ -2820,14 +2825,18 @@
28212826 * @param $revid Integer: ID of the revision being parsed
28222827 * @param $useParserCache Boolean: whether to use the parser cache
28232828 * @param $parserOptions parserOptions to use for the parse operation
2824 - * @param $text String: text to parse or null to load it
 2829+ * @param $content Content|String: content to parse or null to load it; may also be given as a wikitext string, for BC
28252830 */
2826 - function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $text = null ) {
 2831+ function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $content = null ) {
 2832+ if ( is_string($content) ) { #BC: old style call
 2833+ $content = ContentHandler::makeContent( $content, $page->getTitle(), null, $this->revid ); #FIXME: format? from revision?
 2834+ }
 2835+
28272836 $this->page = $page;
28282837 $this->revid = $revid;
28292838 $this->cacheable = $useParserCache;
28302839 $this->parserOptions = $parserOptions;
2831 - $this->text = $text;
 2840+ $this->content = $content;
28322841 $this->cacheKey = ParserCache::singleton()->getKey( $page, $parserOptions );
28332842 parent::__construct( 'ArticleView', $this->cacheKey . ':revid:' . $revid );
28342843 }
@@ -2867,21 +2876,20 @@
28682877
28692878 $isCurrent = $this->revid === $this->page->getLatest();
28702879
2871 - if ( $this->text !== null ) {
2872 - $text = $this->text;
 2880+ if ( $this->content !== null ) {
 2881+ $content = $this->content;
28732882 } elseif ( $isCurrent ) {
2874 - $text = $this->page->getRawText();
 2883+ $content = $this->page->getContent( Revision::RAW ); #XXX: why use RAW audience here, and PUBLIC (default) below?
28752884 } else {
28762885 $rev = Revision::newFromTitle( $this->page->getTitle(), $this->revid );
28772886 if ( $rev === null ) {
28782887 return false;
28792888 }
2880 - $text = $rev->getText();
 2889+ $content = $rev->getContent(); #XXX: why use PUBLIC audience here (default), and RAW above?
28812890 }
28822891
28832892 $time = - wfTime();
2884 - $this->parserOutput = $wgParser->parse( $text, $this->page->getTitle(),
2885 - $this->parserOptions, true, true, $this->revid );
 2893+ $this->parserOutput = $content->getParserOutput( $this->parserOptions );
28862894 $time += wfTime();
28872895
28882896 # Timing hack

Status & tagging log