From 244e8299d13efb7a9809bba0bc52f30d9b97b128 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 26 Jan 2017 19:36:09 +0100 Subject: [PATCH] EditPage: switch from NS_CATEGORY check to instanceof CategoryPage Change-Id: I0ee3672a3d698eda25191bccbbc10c9e2f9f7546 --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); } } -- 2.20.1