From: Aryeh Gregor Date: Thu, 12 Jun 2008 22:06:41 +0000 (+0000) Subject: Another PHP weak typing bug: when section anchors are numeric, the string indexes... X-Git-Tag: 1.31.0-rc.0~47025 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/%27%241//%27%40script%40/%27?a=commitdiff_plain;h=d4e5304e3c0a9b1943282cb2664bd400053cb664;p=lhc%2Fweb%2Fwiklou.git Another PHP weak typing bug: when section anchors are numeric, the string indexes in the $refers array overwrite the numeric indexes, causing it to seem like there are already references with the same name, so extra numbers are added to the end. Reported at: --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 25eea69e12..cebf30fdf0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -368,6 +368,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14500) Site feed (Recentchanges) no longer shows up on the actual recent changes page. * (bug 14511) MediaWiki:Delete-legend is no longer double escaped +* Generate correct section anchors for numeric headers === API changes in 1.13 === diff --git a/includes/Parser.php b/includes/Parser.php index d8540a0655..4daa8f2956 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3570,9 +3570,6 @@ class Parser # HTML names must be case-insensitively unique (bug 10721) $arrayKey = strtolower( $safeHeadline ); - # XXX : Is $refers[$headlineCount] ever accessed, actually ? - $refers[$headlineCount] = $safeHeadline; - # count how many in assoc. array so we can track dupes in anchors isset( $refers[$arrayKey] ) ? $refers[$arrayKey]++ : $refers[$arrayKey] = 1; $refcount[$headlineCount] = $refers[$arrayKey];