From: Brion Vibber Date: Sat, 9 Aug 2008 00:33:02 +0000 (+0000) Subject: Don't freak out about #redirect: [[blah]], this was relatively common usage in older... X-Git-Tag: 1.31.0-rc.0~45991 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=20325cc9ed5e6424f12b632adf656b27b60db173;p=lhc%2Fweb%2Fwiklou.git Don't freak out about #redirect: [[blah]], this was relatively common usage in older Wikipedia edits. --- 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 ) {