Index: trunk/extensions/DumpHTML/dumpHTML.inc |
— | — | @@ -781,27 +781,30 @@ |
782 | 782 | |
783 | 783 | /** Reads the content of a title object, executes the skin and captures the result */ |
784 | 784 | function getArticleHTML( $title ) { |
785 | | - global $wgOut, $wgTitle, $wgUser; |
| 785 | + global $wgOut, $wgTitle, $wgUser, $wgRequest; |
| 786 | + |
786 | 787 | if ( is_null( $title ) ) { |
787 | 788 | return false; |
788 | 789 | } |
| 790 | + |
789 | 791 | LinkCache::singleton()->clear(); |
790 | 792 | |
791 | 793 | $context = new RequestContext(); |
792 | 794 | $context->setRequest( new DumpFauxRequest( $title->getLocalUrl(), |
793 | | - array( 'title' => $title->getPrefixedDbKey() ) ) ); |
| 795 | + array( 'title' => $title->getPrefixedDbKey() ) ) ); |
794 | 796 | $context->setTitle( $title ); |
795 | | - $context->setUser( $wgUser ); |
796 | 797 | |
797 | | - $wgTitle = $title; // b/c |
798 | | - $wgOut = $context->getOutput(); // b/c |
799 | | - $wgOut->parserOptions( new ParserOptions() ); // anon |
| 798 | + // b/c |
| 799 | + $wgTitle = $title; |
| 800 | + $wgOut = $context->getOutput(); |
| 801 | + $wgUser = $context->getUser(); |
| 802 | + $wgRequest = $context->getRequest(); |
800 | 803 | |
801 | | - $ns = $wgTitle->getNamespace(); |
| 804 | + $ns = $title->getNamespace(); |
802 | 805 | if ( $ns == NS_SPECIAL ) { |
803 | | - SpecialPage::executePath( $wgTitle, $context ); |
| 806 | + SpecialPage::executePath( $title, $context ); |
804 | 807 | } else { |
805 | | - $article = Article::newFromTitle( $wgTitle, $context ); |
| 808 | + $article = Article::newFromTitle( $title, $context ); |
806 | 809 | $rt = $article->followRedirect(); |
807 | 810 | if ( is_object( $rt ) ) { |
808 | 811 | return $this->getRedirect( $rt ); |
— | — | @@ -810,9 +813,8 @@ |
811 | 814 | } |
812 | 815 | } |
813 | 816 | |
814 | | - $sk = $context->getSkin(); |
815 | 817 | ob_start(); |
816 | | - $sk->outputPage( $wgOut ); |
| 818 | + $context->getSkin()->outputPage( $context->getOutput() ); |
817 | 819 | $text = ob_get_contents(); |
818 | 820 | ob_end_clean(); |
819 | 821 | |