Avoid exceptions for empty titles in addResultToCache() for sanity
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Jun 2016 06:04:20 +0000 (23:04 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Jun 2016 17:03:20 +0000 (10:03 -0700)
Bug: T137083
Change-Id: Ie8aabba30bc0d7a6910a58104ff08ea036ba962d

includes/cache/LinkBatch.php

index f48e0a5..ec37dd6 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] = [];