Revert r49653 "Make the link regex non-greedy so that it is possible to add '|' to...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Apr 2009 23:33:28 +0000 (23:33 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Apr 2009 23:33:28 +0000 (23:33 +0000)
links."
Pipes would definitely not work in titles. The particular regex change here would for instance break image options if | were added to $wgLegalTitleChars.

includes/parser/Parser.php

index d0942d4..0f57d57 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";
                }