Use createContext() instead of using the global context
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 12 Jul 2011 12:42:57 +0000 (12:42 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 12 Jul 2011 12:42:57 +0000 (12:42 +0000)
includes/api/ApiPurge.php

index bcb6f57..aa69536 100644 (file)
@@ -68,7 +68,8 @@ class ApiPurge extends ApiBase {
                                $result[] = $r;
                                continue;
                        }
-                       $context = RequestContext::getMain();
+                       $context = $this->createContext();
+                       $context->setTitle( $title );
                        $article = Article::newFromTitle( $title, $context );
                        $article->doPurge(); // Directly purge and skip the UI part of purge().
                        $r['purged'] = '';