From 4d15bd9882eb821fabd136c35c87a6b0e79c9a47 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 21 Aug 2004 22:39:56 +0000 Subject: [PATCH] Fix bugzilla bug #100. Redirects can be done to category either by: #REDIRECT [[Category:Music]] (article will be in the category) or #REDIRECT [[:Category:Music]] (article left out of category) --- includes/Title.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/Title.php b/includes/Title.php index 198d5f9119..010494b5d5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -159,6 +159,13 @@ class Title { $rt = NULL; if ( $wgMwRedir->matchStart( $text ) ) { if ( preg_match( '/\\[\\[([^\\]\\|]+)[\\]\\|]/', $text, $m ) ) { + # categories are escaped using : for example one can enter: + # #REDIRECT [[:Category:Music]]. Need to remove it. + if ( substr($m[1],0,1) == ':') { + # We don't want to keep the ':' + $m[1] = substr( $m[1], 1 ); + } + $rt = Title::newFromText( $m[1] ); } } -- 2.20.1