NS_MEDIA also always has page_id 0
authorAryeh Gregor <ayg@aryeh.name>
Sun, 5 May 2019 08:37:01 +0000 (11:37 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Sun, 5 May 2019 08:37:01 +0000 (11:37 +0300)
Change-Id: I0047e5f8e367fe3e8433e715ea56616a6f8dab85

includes/cache/LinkCache.php

index c13f95e..33feee2 100644 (file)
@@ -231,9 +231,7 @@ class LinkCache {
         */
        public function addLinkObj( LinkTarget $nt ) {
                $key = $this->titleFormatter->getPrefixedDBkey( $nt );
-               if ( $this->isBadLink( $key ) || $nt->isExternal()
-                       || $nt->inNamespace( NS_SPECIAL )
-               ) {
+               if ( $this->isBadLink( $key ) || $nt->isExternal() || $nt->getNamespace() < 0 ) {
                        return 0;
                }
                $id = $this->getGoodLinkID( $key );