From: James D. Forrester Date: Tue, 12 Jun 2018 17:44:44 +0000 (-0700) Subject: EditPage::getContextTitle(): Deprecate falling back to $wgTitle X-Git-Tag: 1.34.0-rc.0~5061^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=18faa76dcb73b1873225fa5f9c2b850df7be127a;p=lhc%2Fweb%2Fwiklou.git EditPage::getContextTitle(): Deprecate falling back to $wgTitle Bug: T176526 Change-Id: I7b692def1695119291b26b2f2d25064af9e621f7 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 5dbf873c86..731f874d16 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -211,6 +211,9 @@ because of Phabricator reports. it had unexpected behavior (only marking text if it looked like a URL) and was only used in a single place in the code. Use LanguageConverter::markNoConversion() instead. +* (T176526) EditPage::getContextTitle() falling back to $wgTitle when the + context title is unset is now deprecated; anything creating an EditPage + instance should set the context title via ::setContextTitle(). === Other changes in 1.32 === * … diff --git a/includes/EditPage.php b/includes/EditPage.php index 9aa65505df..92097616f7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -486,17 +486,15 @@ class EditPage { /** * Get the context title object. - * If not set, $wgTitle will be returned. This behavior might change in - * the future to return $this->mTitle instead. + * + * If not set, $wgTitle will be returned, but this is deprecated. This will + * throw an exception. * * @return Title */ public function getContextTitle() { if ( is_null( $this->mContextTitle ) ) { - wfDebugLog( - 'GlobalTitleFail', - __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.' - ); + wfDeprecated( __METHOD__ . ' called with no title set', '1.32' ); global $wgTitle; return $wgTitle; } else {