From: Antoine Musso Date: Sat, 21 Aug 2004 22:39:56 +0000 (+0000) Subject: Fix bugzilla bug #100. Redirects can be done to category either by: X-Git-Tag: 1.5.0alpha1~2263 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=4d15bd9882eb821fabd136c35c87a6b0e79c9a47;p=lhc%2Fweb%2Fwiklou.git 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) --- 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] ); } }