Calling getTitle() right away can lead to reading from
$wgTitle, so check with hasTitle() first.
This avoids a globaltitlefail in ApiEditPage.
Change-Id: I749cc33dd4f1fd6bc7598be34f37e591d822c3f2
* @param WikiPage $p
*/
public function setWikiPage( WikiPage $p ) {
- $contextTitle = $this->getTitle();
$pageTitle = $p->getTitle();
- if ( !$contextTitle || !$pageTitle->equals( $contextTitle ) ) {
+ if ( !$this->hasTitle() || !$pageTitle->equals( $this->getTitle() ) ) {
$this->setTitle( $pageTitle );
}
// Defer this to the end since setTitle sets it to null.