From 1eeb7019c831eeb9633704dfe87a037f6b73f6e6 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Wed, 31 May 2006 07:29:02 +0000 Subject: [PATCH] fix magic => section links (from edit summaries) to sections that have links of the type [[:Image:Foo.jpg]] in their title --- RELEASE-NOTES | 1 + includes/Linker.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 ); -- 2.20.1