Merge "NS_MEDIA also always has page_id 0"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 6 May 2019 11:39:14 +0000 (11:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 6 May 2019 11:39:14 +0000 (11:39 +0000)
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 );