Page MenuHomePhabricator

URLs containing URL-like parameters are split into multiple URLs upon rendering
Closed, DeclinedPublic

Details

Reference
bz6257

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:18 PM
bzimport set Reference to bz6257.
bzimport added a subscriber: Unknown Object (MLST).

we currently support only one url in an url :(
Caused by a preg_match on bits[$i+1] in Parser.php

  1. special case: handle urls as url args:
  2. 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 ))
{

Maybe we should loop through the bits until there is nothing to do :)

wmahan_04 wrote:

One-line fix

Here's a one-line fix with a parser test case.

attachment 6257.patch ignored as obsolete

EN.WP.ST47 wrote:

Corrected patch

This is the same patch with line numbers corrected for r25248

Attached:

Seems to have been fixed at some point, since original test case WFM with trunk. Feel free to reopen if you can replicate this on a recent(ish) copy of MediaWiki.