r79753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79752‎ | r79753 | r79754 >
Date:20:43, 6 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
* Use MediaWiki::articleFromTitle() and Article::followRedirect()
* E_STRICT about set by ref return value of User::getSkin()
Modified paths:
  • /trunk/extensions/DumpHTML/dumpHTML.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/dumpHTML.inc
@@ -799,16 +799,9 @@
800800 $wgOut->parserOptions( new ParserOptions );
801801 SpecialPage::executePath( $wgTitle );
802802 } else {
803 - /** @todo merge with Wiki.php code */
804 - if ( $ns == NS_IMAGE ) {
805 - $wgArticle = new ImagePage( $wgTitle );
806 - } elseif ( $ns == NS_CATEGORY ) {
807 - $wgArticle = new CategoryPage( $wgTitle );
808 - } else {
809 - $wgArticle = new Article( $wgTitle );
810 - }
811 - $rt = Title::newFromRedirect( $wgArticle->fetchContent() );
812 - if ( $rt != NULL ) {
 803+ $wgArticle = MediaWiki::articleFromTitle( $wgTitle );
 804+ $rt = $wgArticle->followRedirect();
 805+ if ( is_object( $rt ) ) {
813806 return $this->getRedirect( $rt );
814807 } else {
815808 $wgOut = new OutputPage;
@@ -818,8 +811,8 @@
819812 }
820813 }
821814
822 -
823 - $sk =& $wgUser->getSkin();
 815+
 816+ $sk = $wgUser->getSkin();
824817 ob_start();
825818 $sk->outputPage( $wgOut );
826819 $text = ob_get_contents();

Status & tagging log