Closed (won't fix)
Project:
Drupal core
Version:
4.7.2
Component:
filter.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2006 at 09:36 UTC
Updated:
24 Jul 2006 at 09:02 UTC
line 1360 or so
do {
$before = $string;
$colonpos = strpos($string, ':');
if ($colonpos > 0) {
$protocol = substr($string, 0, $colonpos);
if (!isset($allowed_protocols[$protocol])) {
$string = substr($string, $colonpos + 1);
}
}
} while ($before != $string);
if string is of form /http://url:port/blah/blah then it fouls it up by removing the entire url rather than just the protocol which breaks things, such as displaying user pictures in profiles.
Possible patch: on mine I tried changing
$colonpos = strpos($string, ':');
to
$colonpos = strpos($string, ':/');
which makes it work again but I'm not sure that's the best way to do it.
Comments
Comment #1
Steven commentedPort numbers work fine, provided the protocol that was specified was valid in the first place. I'm not sure if it was a typo or not, but your URL started with
/http://rather thanhttp://. If I pass URLs such ashttp://test.com:80/through filter_xss_bad_protocol(), they come out unharmed.Comment #2
tunesmith commentedhrm... I don't think it was a typo. That's the form of the url that drupal saw when I printed out the debug output. I'm not the only person that's happened to, either... I am not sure what could be causing it to prepend that preceding slash.