From 4dc0ddc86a04fbdc03e22fd95f57d2e5c4ae9f3a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 18 Oct 2007 15:55:41 +0000 Subject: [PATCH] * Fix regression in LinkBatch.php breaking PHP 5.0 PHP 5.0.5 is unhappy about current(array_keys($dbkeys)), since current() is one of those magic things that uses the pointer in an array. Probably key($dbkeys) would do the job instead, but I rather dislike all those funcs. :) Grabbing a temporary var in array_keys() instead for cleanliness. --- RELEASE-NOTES | 1 + includes/LinkBatch.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index eed4ddbeee..d6bed90341 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -107,6 +107,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11690) Show revert link for page moves in Special:Log to allowed users only * Initial-lowercase prefix checks in namespaceDupes.php now actually work. +* Fix regression in LinkBatch.php breaking PHP 5.0 === API changes in 1.12 === diff --git a/includes/LinkBatch.php b/includes/LinkBatch.php index 8ab3393e08..20bcd3d44e 100644 --- a/includes/LinkBatch.php +++ b/includes/LinkBatch.php @@ -158,9 +158,9 @@ class LinkBatch { } if (count($dbkeys)==1) { // avoid multiple-reference syntax if simple equality can be used - + $singleKey = array_keys($dbkeys); $sql .= "({$prefix}_namespace=$ns AND {$prefix}_title=". - $db->addQuotes(current(array_keys($dbkeys))). + $db->addQuotes($singleKey[0]). ")"; } else { $sql .= "({$prefix}_namespace=$ns AND {$prefix}_title IN ("; -- 2.20.1