diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-11-15 10:48:24 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-11-15 10:48:24 +0100 |
commit | 601f1eb624fce19a1da966e0e102b208a6ae7b74 (patch) | |
tree | c056ad6dd6a173d342b6b86252e086e7d68271da /Zotlabs/Storage | |
parent | 301b41eaa4f3087624a57d1471f76d903c604a5b (diff) | |
parent | 8e534918672c2ccf3614623b8bd368d18318f453 (diff) | |
download | volse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.tar.gz volse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.tar.bz2 volse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r-- | Zotlabs/Storage/Browser.php | 2 | ||||
-rw-r--r-- | Zotlabs/Storage/Directory.php | 11 | ||||
-rw-r--r-- | Zotlabs/Storage/File.php | 11 |
3 files changed, 22 insertions, 2 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index 77201f387..b5440aacf 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -210,8 +210,6 @@ class Browser extends DAV\Browser\Plugin { } } - - $attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>"; // put the array for this file together diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index 0ed7a3c68..27df3569f 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -299,6 +299,17 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { $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($hash), + intval($c[0]['channel_id']) + ); + } + + // updates entry with filesize and timestamp $d = q("UPDATE attach SET filesize = '%s', os_path = '%s', display_path = '%s', is_photo = %d, edited = '%s' WHERE hash = '%s' AND uid = %d", dbesc($size), 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 |