From: Brion Vibber Date: Thu, 18 Oct 2007 15:55:41 +0000 (+0000) Subject: * Fix regression in LinkBatch.php breaking PHP 5.0 X-Git-Tag: 1.31.0-rc.0~51115 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=4dc0ddc86a04fbdc03e22fd95f57d2e5c4ae9f3a;p=lhc%2Fweb%2Fwiklou.git * 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. --- 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 (";