From: Bartosz DziewoƄski Date: Wed, 1 Jun 2016 20:12:59 +0000 (+0200) Subject: LinkBatch: Cast array keys to string when constructing TitleValue X-Git-Tag: 1.31.0-rc.0~6734 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=8e38519e071bfff1ea0ff7b65a4c60c5fe33d02d;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;