From: Erik Moeller Date: Wed, 31 May 2006 07:29:02 +0000 (+0000) Subject: fix magic => section links (from edit summaries) to sections that have links of the... X-Git-Tag: 1.31.0-rc.0~56956 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=1eeb7019c831eeb9633704dfe87a037f6b73f6e6;p=lhc%2Fweb%2Fwiklou.git fix magic => section links (from edit summaries) to sections that have links of the type [[:Image:Foo.jpg]] in their title --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 38d945a9d6..1a1a72446b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Linker.php b/includes/Linker.php index de0ce12ed3..30d0a310d1 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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 );