mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-19 21:43:42 +00:00
[twitter] Fix Read Error with exif_imagetype()
This commit is contained in:
parent
ce97e09126
commit
bda506fd2e
1 changed files with 8 additions and 1 deletions
|
@ -1183,7 +1183,14 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
|
|
||||||
$tempfile = tempnam(get_temppath(), "cache");
|
$tempfile = tempnam(get_temppath(), "cache");
|
||||||
file_put_contents($tempfile, $img_str);
|
file_put_contents($tempfile, $img_str);
|
||||||
|
|
||||||
|
// See http://php.net/manual/en/function.exif-imagetype.php#79283
|
||||||
|
if (filesize($tempfile) > 11) {
|
||||||
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
||||||
|
} else {
|
||||||
|
$mime = false;
|
||||||
|
}
|
||||||
|
|
||||||
unlink($tempfile);
|
unlink($tempfile);
|
||||||
|
|
||||||
if (substr($mime, 0, 6) == "image/") {
|
if (substr($mime, 0, 6) == "image/") {
|
||||||
|
|
Loading…
Reference in a new issue