From 8e38519e071bfff1ea0ff7b65a4c60c5fe33d02d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 1 Jun 2016 22:12:59 +0200 Subject: [PATCH] LinkBatch: Cast array keys to string when constructing TitleValue If $dbkey consisted only of numbers (0-9), PHP converts it to an integer when using it as array key, and then returns it as an integer when iterating over the array. This is normally fine, but TitleValue does strict type checking. Follow-up to 682116760198a7420a809e0b9966ecdc63f1c67d. Bug: T136615 Change-Id: I894800c3f5aec0c2d0c23f8adfa1b840495f3b16 --- includes/cache/LinkBatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index 04d2524d91..f48e0a5167 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -168,7 +168,7 @@ class LinkBatch { // The remaining links in $data are bad links, register them as such foreach ( $remaining as $ns => $dbkeys ) { foreach ( $dbkeys as $dbkey => $unused ) { - $title = new TitleValue( (int)$ns, $dbkey ); + $title = new TitleValue( (int)$ns, (string)$dbkey ); $cache->addBadLinkObj( $title ); $pdbk = $titleFormatter->getPrefixedDBkey( $title ); $ids[$pdbk] = 0; -- 2.20.1