From d4e5304e3c0a9b1943282cb2664bd400053cb664 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 12 Jun 2008 22:06:41 +0000 Subject: [PATCH] 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: --- RELEASE-NOTES | 1 + includes/Parser.php | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) 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]; -- 2.20.1