From 0d499494cdbcb8f6e9e84cf5961b56a9aa7f7421 Mon Sep 17 00:00:00 2001 From: Remember the dot Date: Sun, 19 Apr 2009 22:20:12 +0000 Subject: [PATCH] Make the link regex non-greedy so that it is possible to add '|' to $wgLegalTitleChars and still be able to pipe 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 0f57d571b2..d0942d4f2c 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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"; } -- 2.20.1