From: addshore Date: Thu, 26 Jan 2017 18:36:09 +0000 (+0100) Subject: EditPage: switch from NS_CATEGORY check to instanceof CategoryPage X-Git-Tag: 1.31.0-rc.0~4190^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=244e8299d13efb7a9809bba0bc52f30d9b97b128;p=lhc%2Fweb%2Fwiklou.git EditPage: switch from NS_CATEGORY check to instanceof CategoryPage Change-Id: I0ee3672a3d698eda25191bccbbc10c9e2f9f7546 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index e070ca3c29..f171443ff4 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3282,14 +3282,14 @@ HTML */ protected function showPreview( $text ) { global $wgOut; - if ( $this->mTitle->getNamespace() == NS_CATEGORY ) { + if ( $this->mArticle instanceof CategoryPage ) { $this->mArticle->openShowCategory(); } # This hook seems slightly odd here, but makes things more # consistent for extensions. Hooks::run( 'OutputPageBeforeHTML', [ &$wgOut, &$text ] ); $wgOut->addHTML( $text ); - if ( $this->mTitle->getNamespace() == NS_CATEGORY ) { + if ( $this->mArticle instanceof CategoryPage ) { $this->mArticle->closeShowCategory(); } }