Index: trunk/phase3/includes/api/ApiPurge.php |
— | — | @@ -68,18 +68,18 @@ |
69 | 69 | $result[] = $r; |
70 | 70 | continue; |
71 | 71 | } |
72 | | - $context = new DerivativeContext( $this->getContext() ); |
73 | | - $context->setTitle( $title ); |
74 | | - $article = Article::newFromTitle( $title, $context ); |
75 | | - $article->doPurge(); // Directly purge and skip the UI part of purge(). |
| 72 | + |
| 73 | + $page = WikiPage::factory( $title ); |
| 74 | + $page->doPurge(); // Directly purge and skip the UI part of purge(). |
76 | 75 | $r['purged'] = ''; |
77 | 76 | |
78 | 77 | if( $forceLinkUpdate ) { |
79 | 78 | if ( !$user->pingLimiter() ) { |
80 | 79 | global $wgParser, $wgEnableParserCache; |
81 | | - $popts = new ParserOptions(); |
82 | | - $p_result = $wgParser->parse( $article->getContent(), $title, $popts ); |
83 | 80 | |
| 81 | + $popts = ParserOptions::newFromContext( $this->getContext() ); |
| 82 | + $p_result = $wgParser->parse( $page->getRawText(), $title, $popts ); |
| 83 | + |
84 | 84 | # Update the links tables |
85 | 85 | $u = new LinksUpdate( $title, $p_result ); |
86 | 86 | $u->doUpdate(); |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | |
90 | 90 | if ( $wgEnableParserCache ) { |
91 | 91 | $pcache = ParserCache::singleton(); |
92 | | - $pcache->save( $p_result, $article, $popts ); |
| 92 | + $pcache->save( $p_result, $page, $popts ); |
93 | 93 | } |
94 | 94 | } else { |
95 | 95 | $this->setWarning( $this->parseMsg( array( 'actionthrottledtext' ) ) ); |