Make the link regex non-greedy so that it is possible to add '|' to $wgLegalTitleChar...
authorRemember the dot <rememberthedot@users.mediawiki.org>
Sun, 19 Apr 2009 22:20:12 +0000 (22:20 +0000)
committerRemember the dot <rememberthedot@users.mediawiki.org>
Sun, 19 Apr 2009 22:20:12 +0000 (22:20 +0000)
links. This change should have no effect on the default configuration, which does not include '|' in
$wgLegalTitleChars because including it still breaks other things.

includes/parser/Parser.php

index 0f57d57..d0942d4 100644 (file)
@@ -1460,7 +1460,7 @@ class Parser
                if ( !$tc ) { 
                        $tc = Title::legalChars() . '#%';
                        # Match a link having the form [[namespace:link|alternate]]trail
-                       $e1 = "/^([{$tc}]+)(?:\\|(.+?))?]](.*)\$/sD";
+                       $e1 = "/^([{$tc}]+?)(?:\\|(.+?))?]](.*)\$/sD";
                        # Match cases where there is no "]]", which might still be images
                        $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD";
                }