From: Brad Jorsch Date: Sat, 14 Mar 2015 01:11:13 +0000 (-0400) Subject: Set main RequestContext title in api.php X-Git-Tag: 1.31.0-rc.0~12087 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=8f176b04c97baf152ea9ce73ad60247dc01885b6;p=lhc%2Fweb%2Fwiklou.git 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 --- 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,