aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage/File.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-15 12:41:03 -0800
committerzotlabs <mike@macgirvin.com>2017-11-15 12:41:03 -0800
commitcf4588f16fbe6dc55eabdb590480bc88d560dad3 (patch)
treec056ad6dd6a173d342b6b86252e086e7d68271da /Zotlabs/Storage/File.php
parentd43542dd7a64136626550ba0569b1939b84b8146 (diff)
parent601f1eb624fce19a1da966e0e102b208a6ae7b74 (diff)
downloadvolse-hubzilla-cf4588f16fbe6dc55eabdb590480bc88d560dad3.tar.gz
volse-hubzilla-cf4588f16fbe6dc55eabdb590480bc88d560dad3.tar.bz2
volse-hubzilla-cf4588f16fbe6dc55eabdb590480bc88d560dad3.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Storage/File.php')
-rw-r--r--Zotlabs/Storage/File.php11
1 files changed, 11 insertions, 0 deletions
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