From e804f4543ee787babfd5ce90fd5b0798f8da1673 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 24 Mar 2006 16:38:34 +0000 Subject: [PATCH] Handle urls as external-url args --- includes/Parser.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/Parser.php b/includes/Parser.php index eb1f3f2f34..33bfadfa06 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1207,6 +1207,19 @@ class Parser $url = $protocol . $m[1]; $trail = $m[2]; + # special case: handle urls as url args: + # http://www.example.com/foo?=http://www.example.com/bar + if(strlen($trail) == 0 && + isset($bits[$i]) && + preg_match('/^'. wfUrlProtocols() . '$/S', $bits[$i]) && + preg_match( '/^('.EXT_LINK_URL_CLASS.'+)(.*)$/s', $bits[$i + 1], $m )) + { + # add protocol, arg + $url .= $bits[$i] . $bits[$i + 1]; # protocol, url as arg to previous link + $i += 2; + $trail = $m[2]; + } + # The characters '<' and '>' (which were escaped by # removeHTMLtags()) should not be included in # URLs, per RFC 2396. -- 2.20.1