fix magic => section links (from edit summaries) to sections that have links of the...
authorErik Moeller <erik@users.mediawiki.org>
Wed, 31 May 2006 07:29:02 +0000 (07:29 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Wed, 31 May 2006 07:29:02 +0000 (07:29 +0000)
RELEASE-NOTES
includes/Linker.php

index 38d945a..1a1a724 100644 (file)
@@ -387,6 +387,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6125) Add links to edit old versions to diff views
 * (bug 5127) Auto edit summary when creating redirect page
 * (bug 3926) Introduce {{#language:}} magic word
+* Fix section links from edit comments for [[:Image:Bla.jpg]] in section titles
 
 == Compatibility ==
 
index de0ce12..30d0a31 100644 (file)
@@ -895,7 +895,12 @@ class Linker {
                        if( $title ) {
                                $section = $auto;
 
-                               # This is hackish but should work in most cases.
+                               # Generate a valid anchor name from the section title.
+                               # Hackish, but should generally work - we strip wiki
+                               # syntax, including the magic [[: that is used to
+                               # "link rather than show" in case of images and
+                               # interlanguage links.
+                               $section = str_replace( '[[:', '', $section );
                                $section = str_replace( '[[', '', $section );
                                $section = str_replace( ']]', '', $section );
                                $sectionTitle = wfClone( $title );