Index: trunk/extensions/DumpHTML/dumpHTML.inc |
— | — | @@ -786,37 +786,36 @@ |
787 | 787 | /** Reads the content of a title object, executes the skin and captures the result */ |
788 | 788 | function getArticleHTML( $title ) { |
789 | 789 | global $wgOut, $wgTitle, $wgUser; |
790 | | - |
791 | | - $linkCache =& LinkCache::singleton(); |
792 | | - $linkCache->clear(); |
793 | | - $wgTitle = $title; |
794 | | - if ( is_null( $wgTitle ) ) { |
| 790 | + if ( is_null( $title ) ) { |
795 | 791 | return false; |
796 | 792 | } |
| 793 | + $linkCache =& LinkCache::singleton(); |
| 794 | + $linkCache->clear(); |
797 | 795 | |
| 796 | + $context = new RequestContext(); |
| 797 | + $context->setTitle( $title ); |
| 798 | + $context->setUser( $wgUser ); |
| 799 | + |
| 800 | + $wgTitle = $title; // b/c |
| 801 | + $wgOut = new OutputPage( $context ); |
| 802 | + $wgOut->parserOptions( new ParserOptions() ); // anon |
| 803 | + |
| 804 | + $context->setOutput( $wgOut ); |
| 805 | + |
798 | 806 | $ns = $wgTitle->getNamespace(); |
799 | 807 | if ( $ns == NS_SPECIAL ) { |
800 | | - $wgOut = new OutputPage; |
801 | | - $wgOut->parserOptions( new ParserOptions ); |
802 | | - $wgOut->setTitle( $title ); |
803 | | - SpecialPage::executePath( $wgTitle, RequestContext::getMain() ); |
| 808 | + SpecialPage::executePath( $wgTitle, $context ); |
804 | 809 | } else { |
805 | | - $article = MediaWiki::articleFromTitle( $wgTitle, RequestContext::getMain() ); |
| 810 | + $article = MediaWiki::articleFromTitle( $wgTitle, $context ); |
806 | 811 | $rt = $article->followRedirect(); |
807 | 812 | if ( is_object( $rt ) ) { |
808 | 813 | return $this->getRedirect( $rt ); |
809 | 814 | } else { |
810 | | - $wgOut = new OutputPage; |
811 | | - $wgOut->parserOptions( new ParserOptions ); |
812 | | - $wgOut->setTitle( $title ); |
813 | | - |
814 | 815 | $article->view(); |
815 | 816 | } |
816 | 817 | } |
817 | 818 | |
818 | | - |
819 | | - $sk = $wgUser->getSkin(); |
820 | | - $sk->setTitle( $title ); |
| 819 | + $sk = $context->getSkin(); |
821 | 820 | ob_start(); |
822 | 821 | $sk->outputPage( $wgOut ); |
823 | 822 | $text = ob_get_contents(); |
Index: trunk/extensions/DumpHTML/SkinOffline.php |
— | — | @@ -48,15 +48,15 @@ |
49 | 49 | $content_actions = array(); |
50 | 50 | $nskey = $this->getNameSpaceKey(); |
51 | 51 | $content_actions[$nskey] = $this->tabAction( |
52 | | - $this->mTitle->getSubjectPage(), |
| 52 | + $this->getTitle()->getSubjectPage(), |
53 | 53 | $nskey, |
54 | | - !$this->mTitle->isTalkPage() ); |
| 54 | + !$this->getTitle()->isTalkPage() ); |
55 | 55 | |
56 | | - if( $this->mTitle->canTalk() ) { |
| 56 | + if( $this->getTitle()->canTalk() ) { |
57 | 57 | $content_actions['talk'] = $this->tabAction( |
58 | | - $this->mTitle->getTalkPage(), |
| 58 | + $this->getTitle()->getTalkPage(), |
59 | 59 | 'talk', |
60 | | - $this->mTitle->isTalkPage(), |
| 60 | + $this->getTitle()->isTalkPage(), |
61 | 61 | '', |
62 | 62 | true); |
63 | 63 | } |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | if ( isset( $wgHTMLDump ) ) { |
66 | 66 | $content_actions['current'] = array( |
67 | 67 | 'text' => wfMsg( 'currentrev' ), |
68 | | - 'href' => str_replace( '$1', wfUrlencode( $this->mTitle->getPrefixedDBkey() ), |
| 68 | + 'href' => str_replace( '$1', wfUrlencode( $this->getTitle()->getPrefixedDBkey() ), |
69 | 69 | $wgHTMLDump->oldArticlePath ), |
70 | 70 | 'class' => false |
71 | 71 | ); |