r13300 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13299‎ | r13300 | r13301 >
Date:16:38, 24 March 2006
Author:gabrielwicke
Status:old
Tags:
Comment:
Handle urls as external-url args
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -1207,6 +1207,19 @@
12081208 $url = $protocol . $m[1];
12091209 $trail = $m[2];
12101210
 1211+ # special case: handle urls as url args:
 1212+ # http://www.example.com/foo?=http://www.example.com/bar
 1213+ if(strlen($trail) == 0 &&
 1214+ isset($bits[$i]) &&
 1215+ preg_match('/^'. wfUrlProtocols() . '$/S', $bits[$i]) &&
 1216+ preg_match( '/^('.EXT_LINK_URL_CLASS.'+)(.*)$/s', $bits[$i + 1], $m ))
 1217+ {
 1218+ # add protocol, arg
 1219+ $url .= $bits[$i] . $bits[$i + 1]; # protocol, url as arg to previous link
 1220+ $i += 2;
 1221+ $trail = $m[2];
 1222+ }
 1223+
12111224 # The characters '<' and '>' (which were escaped by
12121225 # removeHTMLtags()) should not be included in
12131226 # URLs, per RFC 2396.

Status & tagging log