Skip to content

Commit 62d9a73

Browse files
authored
Only access icon if download ok (#2887)
1 parent 2cc5dd6 commit 62d9a73

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

plugins/tracklabels/action.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ function image_name($prefix, $req_field)
8787
$client->read_timeout = 5;
8888
$client->_fp_timeout = 5;
8989
@$client->fetchComplex($url);
90-
if ($client->status == 200)
90+
if ($client->status == 200) {
9191
file_put_contents($ico_name, $client->results);
92-
if (strpos(mime_content_type($ico_name), "image/")===false)
93-
@unlink($ico_name);
94-
try_send_image($ico_name, 'image/x-icon');
92+
if (strpos(mime_content_type($ico_name), "image/")===false)
93+
@unlink($ico_name);
94+
else
95+
try_send_image($ico_name, 'image/x-icon');
96+
}
9597
}
9698
}
9799
}

0 commit comments

Comments
 (0)