Extension checking fails when downloading a remote URL that contains a query string.

Example: http://example.com/foo.jpg?bar=baz

FileField considers the extension to be jpg?bar=baz, which doesn't match jpg.

I believe this can be fixed by altering lines 114-116 of remote.inc as follows. I havent throughly tested this, though.

$url = $item['filefield_remote']['url'];
$parsed_url = parse_url($url);
$pathinfo = pathinfo($parsed_url['path']);
$filename = rawurldecode(basename($parsed_url['path']));

Comments

quicksketch’s picture

Thanks, sounds like a good approach to fixing this problem.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new780 bytes

I've taken the suggested approach an applied it to CVS with the attached patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.