From: Timo Tijhof Date: Mon, 7 Mar 2016 23:29:20 +0000 (+0000) Subject: context: Support setting title to null X-Git-Tag: 1.31.0-rc.0~7723^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=92ce715a55ab6998f916cbe9792af9fdb7d27fd9;p=lhc%2Fweb%2Fwiklou.git context: Support setting title to null We have various entry points without a title set: * load.php: Setup.php defaults $wgTitle to null. When messages are parsed, MessageCache::parse() will emit a warning and uses $wgTitle which is then casted to Special:Badtitle. * Parser tests: Work all with context now (or parser options) without ever setting $wgTitle. However, in order to allow SpecialPageFactory to getTitle() and then setTitle() the same value from context, context needs to support setting null as title, the same way it can get null as title. Change-Id: I770f449fe67beedc3f7d4009ed2208e9dde4491c --- diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 35ee1b7ec4..c8b8108830 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -167,7 +167,7 @@ class RequestContext implements IContextSource, MutableContext { * * @param Title $title */ - public function setTitle( Title $title ) { + public function setTitle( Title $title = null ) { $this->title = $title; // Erase the WikiPage so a new one with the new title gets created. $this->wikipage = null;