From 7c5d3cf8947b57ec2ec236c05edf9e51c0776380 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 12 Jul 2011 12:42:57 +0000 Subject: [PATCH] Use createContext() instead of using the global context --- includes/api/ApiPurge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'] = ''; -- 2.20.1