From 8f176b04c97baf152ea9ce73ad60247dc01885b6 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Fri, 13 Mar 2015 21:11:13 -0400 Subject: [PATCH] Set main RequestContext title in api.php We set $wgTitle to a dummy title, and RequestContext::getMain()->getTitle() falls back to that so everything *works*, but RequestContext whines about it. Set the same dummy title explicitly on RequestContext::getMain() to shut things up. Bug: T78414 Change-Id: I5b90df16cf2f51a6edd5898e9712161f335202a7 --- api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api.php b/api.php index d63f2540db..7788a36c2f 100644 --- a/api.php +++ b/api.php @@ -61,6 +61,10 @@ if ( !$wgEnableAPI ) { // In a perfect world this wouldn't be necessary $wgTitle = Title::makeTitle( NS_MAIN, 'API' ); +// RequestContext will read from $wgTitle, but it will also whine about it. +// In a perfect world this wouldn't be necessary either. +RequestContext::getMain()->setTitle( $wgTitle ); + try { /* Construct an ApiMain with the arguments passed via the URL. What we get back * is some form of an ApiMain, possibly even one that produces an error message, -- 2.20.1