From 59485d984c1645b7494d1a7d7528c36d44f3e1d8 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 19 Sep 2017 22:06:43 -0700 Subject: [PATCH] EditPage: Deprecate public isCssJsSubpage related member variables Just use the functions directly. Change-Id: Ie374a5cd4c9255b595ff4a88025738720434a802 --- includes/EditPage.php | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index b40a0543fc..cc9aa7eb29 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -230,16 +230,28 @@ class EditPage { /** @var bool */ public $isConflict = false; - /** @var bool */ + /** + * @deprecated since 1.30 use Title::isCssJsSubpage() + * @var bool + */ public $isCssJsSubpage = false; - /** @var bool */ + /** + * @deprecated since 1.30 use Title::isCssSubpage() + * @var bool + */ public $isCssSubpage = false; - /** @var bool */ + /** + * @deprecated since 1.30 use Title::isJsSubpage() + * @var bool + */ public $isJsSubpage = false; - /** @var bool */ + /** + * @deprecated since 1.30 + * @var bool + */ public $isWrongCaseCssJsPage = false; /** @var bool New page or new section */ @@ -627,10 +639,11 @@ class EditPage { $this->isConflict = false; // css / js subpages of user pages get a special treatment + // The following member variables are deprecated since 1.30, + // the functions should be used instead. $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage(); $this->isCssSubpage = $this->mTitle->isCssSubpage(); $this->isJsSubpage = $this->mTitle->isJsSubpage(); - // @todo FIXME: Silly assignment. $this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage(); # Show applicable editing introductions @@ -2795,7 +2808,7 @@ class EditPage { $out->addHTML( $this->editFormTextBeforeContent ); - if ( !$this->isCssJsSubpage && $showToolbar && $user->getOption( 'showtoolbar' ) ) { + if ( !$this->mTitle->isCssJsSubpage() && $showToolbar && $user->getOption( 'showtoolbar' ) ) { $out->addHTML( self::getEditToolbar( $this->mTitle ) ); } @@ -3031,27 +3044,28 @@ class EditPage { ); } } else { - if ( $this->isCssJsSubpage ) { + if ( $this->mTitle->isCssJsSubpage() ) { # Check the skin exists - if ( $this->isWrongCaseCssJsPage ) { + if ( $this->isWrongCaseCssJsPage() ) { $out->wrapWikiMsg( "
\n$1\n
", [ 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ] ); } if ( $this->getTitle()->isSubpageOf( $user->getUserPage() ) ) { + $isCssSubpage = $this->mTitle->isCssSubpage(); $out->wrapWikiMsg( '
$1
', - $this->isCssSubpage ? 'usercssispublic' : 'userjsispublic' + $isCssSubpage ? 'usercssispublic' : 'userjsispublic' ); if ( $this->formtype !== 'preview' ) { - if ( $this->isCssSubpage && $wgAllowUserCss ) { + if ( $isCssSubpage && $wgAllowUserCss ) { $out->wrapWikiMsg( "
\n$1\n
", [ 'usercssyoucanpreview' ] ); } - if ( $this->isJsSubpage && $wgAllowUserJs ) { + if ( $this->mTitle->isJsSubpage() && $wgAllowUserJs ) { $out->wrapWikiMsg( "
\n$1\n
", [ 'userjsyoucanpreview' ] -- 2.20.1