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']));| Comment | File | Size | Author |
|---|---|---|---|
| #2 | filefield_sources_remote_query_string.patch | 780 bytes | quicksketch |
Comments
Comment #1
quicksketchThanks, sounds like a good approach to fixing this problem.
Comment #2
quicksketchI've taken the suggested approach an applied it to CVS with the attached patch.