EditPage: switch from NS_CATEGORY check to instanceof CategoryPage
authoraddshore <addshorewiki@gmail.com>
Thu, 26 Jan 2017 18:36:09 +0000 (19:36 +0100)
committeraddshore <addshorewiki@gmail.com>
Thu, 26 Jan 2017 19:06:10 +0000 (20:06 +0100)
Change-Id: I0ee3672a3d698eda25191bccbbc10c9e2f9f7546

includes/EditPage.php

index e070ca3..f171443 100644 (file)
@@ -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();
                }
        }