From 8e534918672c2ccf3614623b8bd368d18318f453 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 14 Nov 2017 17:39:33 -0800 Subject: sort out a few more large image upload issues --- Zotlabs/Storage/File.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Zotlabs/Storage/File.php') diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 947a9fde3..8bf9997ed 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -168,6 +168,17 @@ class File extends DAV\Node implements DAV\IFile { if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG)) { $is_photo = 1; } + + // If we know it's a photo, over-ride the type in case the source system could not determine what it was + + if($is_photo) { + q("update attach set filetype = '%s' where hash = '%s' and uid = %d", + dbesc($gis['mime']), + dbesc($this->data['hash']), + intval($this->data['uid']) + ); + } + } else { // this shouldn't happen any more -- cgit v1.2.3