Style and IDEA warning cleanups
[lhc/web/wiklou.git] / includes / cache / LinkBatch.php
index f48e0a5..e6d8630 100644 (file)
@@ -73,8 +73,8 @@ class LinkBatch {
         * @param string $dbkey
         */
        public function add( $ns, $dbkey ) {
-               if ( $ns < 0 ) {
-                       return;
+               if ( $ns < 0 || $dbkey === '' ) {
+                       return; // T137083
                }
                if ( !array_key_exists( $ns, $this->data ) ) {
                        $this->data[$ns] = [];
@@ -188,7 +188,7 @@ class LinkBatch {
                }
 
                // This is similar to LinkHolderArray::replaceInternal
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $table = 'page';
                $fields = array_merge(
                        LinkCache::getSelectFields(),