diff options
author | Andrew Dolgov <[email protected]> | 2010-04-22 10:10:49 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-04-22 10:10:49 +0400 |
commit | a1af15741005290157baa6b1df724a5becee1738 (patch) | |
tree | 003f8b75187f99564912b6f5f77f11878ae18d9e /images/blank_icon.gif | |
parent | 83573d3118112668a56e376b4748eef6e6961d50 (diff) |
Fix several problems with image download
Fix fetch_file_contents, so that it returns the contents even if the data isn't
an image. This is needed because the get_favicon_url function tries to download
the webpage using this function, to see if there is a favicon in the page.
The function now takes an optional $type parameter. This parameter control if
the calling function cares about the content-type, or if the function should
just return everything. If the $type parameter is set, the content-type should
contain the string contained in $type, otherwise the function returns false.
The second problem solved with this patch, is that the temporary file that
should contain the image was empty in some cases. I never found out why this
happended, but as curl_exec is capable of returning the fetched data, thus
eliminating the need for the temporary file all together, the function have
been changed to use this way of obtaining the data.
The last problem fixed by this patch is that curl will now follow redirects.
Author: Klaus S. Madsen <[email protected]>
Diffstat (limited to 'images/blank_icon.gif')
0 files changed, 0 insertions, 0 deletions