When an invalid url is passed into imagecache_external_fetch(), a notice "undefined index 'host'" is thrown, because it is assumed that parse_url returns an array with that key. Adding a check that checks if the key is there (and not empty) fixes this. If the check fails, the URL is invalid (you must have a host) so we can return FALSE.
A patch is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | imagecache_external-check_if_host_is_not_empty-2.patch | 539 bytes | marty2081 |
Comments
Comment #1
marty2081 commentedCorrected the patch.
Comment #2
BarisW commentedThanks a lot for the patch. I fixed it in another way, but added the commit on your name.