* Fix regression in LinkBatch.php breaking PHP 5.0
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 18 Oct 2007 15:55:41 +0000 (15:55 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 18 Oct 2007 15:55:41 +0000 (15:55 +0000)
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
includes/LinkBatch.php

index eed4ddb..d6bed90 100644 (file)
@@ -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 ===
index 8ab3393..20bcd3d 100644 (file)
@@ -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 (";