From 20325cc9ed5e6424f12b632adf656b27b60db173 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 9 Aug 2008 00:33:02 +0000 Subject: [PATCH] Don't freak out about #redirect: [[blah]], this was relatively common usage in older Wikipedia edits. --- includes/Title.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index e3124d58dc..ed28f8b6e4 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -300,8 +300,9 @@ class Title { if( $redir->matchStartAndRemove( $text ) ) { // Extract the first link and see if it's usable // Ensure that it really does come directly after #REDIRECT + // Some older redirects included a colon, so don't freak about that! $m = array(); - if( preg_match( '!^\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) { + if( preg_match( '!^\s*:?\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) { // Strip preceding colon used to "escape" categories, etc. // and URL-decode links if( strpos( $m[1], '%' ) !== false ) { -- 2.20.1