Merge "EditPage: switch from NS_CATEGORY check to instanceof CategoryPage"
[lhc/web/wiklou.git] / includes / EditPage.php
index 0a1ae1e..2b1bd7b 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();
                }
        }