summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-16 16:24:18 +0300
committerAndrew Dolgov <[email protected]>2009-12-16 16:24:18 +0300
commitb987df9a7f64b272a17b32112f0a62b4b2ef8bd0 (patch)
tree7a1bc0ca9612152383a3e2f9effb8ec60730a1f4 /functions.php
parent97f31c4810f42e49394d43be6b8ce65a6b6f62d7 (diff)
parent7af0309b7b2c581573fa90ff345d08928b1eba69 (diff)
Merge branch 'master' of /home/fox/public_html/testbox/tt-rss
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 7980b68d8..dfe1a41c6 100644
--- a/functions.php
+++ b/functions.php
@@ -362,11 +362,17 @@
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
curl_exec($ch);
- curl_close($ch);
- fclose($fp);
+
+ if (strpos(curl_getinfo($ch, CURLINFO_CONTENT_TYPE), "image/") !== false) {
+ curl_close($ch);
+ fclose($fp);
+ $contents = file_get_contents($tmpfile);
+ } else {
+ curl_close($ch);
+ fclose($fp);
+ }
}
- $contents = file_get_contents($tmpfile);
unlink($tmpfile);
return $contents;