Rename DB_SLAVE constant to DB_REPLICA
[lhc/web/wiklou.git] / includes / cache / LinkCache.php
index de44f9b..6a602df 100644 (file)
@@ -230,7 +230,9 @@ class LinkCache {
         */
        public function addLinkObj( LinkTarget $nt ) {
                $key = $this->titleFormatter->getPrefixedDBkey( $nt );
-               if ( $this->isBadLink( $key ) || $nt->isExternal() ) {
+               if ( $this->isBadLink( $key ) || $nt->isExternal()
+                       || $nt->inNamespace( NS_SPECIAL )
+               ) {
                        return 0;
                }
                $id = $this->getGoodLinkID( $key );
@@ -243,7 +245,7 @@ class LinkCache {
                }
 
                // Some fields heavily used for linking...
-               $db = $this->mForUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
+               $db = $this->mForUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA );
 
                $row = $db->selectRow( 'page', self::getSelectFields(),
                        [ 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ],