From: Alexandre Emsenhuber Date: Tue, 12 Jul 2011 12:42:57 +0000 (+0000) Subject: Use createContext() instead of using the global context X-Git-Tag: 1.31.0-rc.0~28912 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=7c5d3cf8947b57ec2ec236c05edf9e51c0776380;p=lhc%2Fweb%2Fwiklou.git Use createContext() instead of using the global context --- diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index bcb6f57628..aa695361c6 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -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'] = '';