From aed682305173a67b2af1a56b8595445bec690e2b Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 7 Dec 2019 20:14:17 +0100 Subject: Add .webp image format support --- Zotlabs/Storage/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Storage/File.php') diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 4610aceb7..36aff1e05 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -169,7 +169,7 @@ class File extends DAV\Node implements DAV\IFile { } $gis = @getimagesize($f); logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA); - if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG)) { + if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG || $gis[2] === IMAGETYPE_WEBP)) { $is_photo = 1; } -- cgit v1.2.3 From 328685d2fbe505fd5b1bf9892a0cce993210ac52 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Apr 2020 09:38:36 +0000 Subject: move from build_sync_packet() to Libsync::build_sync_packet() --- Zotlabs/Storage/File.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Storage/File.php') diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 36aff1e05..68edde166 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -3,6 +3,7 @@ namespace Zotlabs\Storage; use Sabre\DAV; +use Zotlabs\Lib\Libsync; /** * @brief This class represents a file in DAV. @@ -106,7 +107,7 @@ class File extends DAV\Node implements DAV\IFile { if($ch) { $sync = attach_export_data($ch,$this->data['hash']); if($sync) - build_sync_packet($ch['channel_id'],array('file' => array($sync))); + Libsync::build_sync_packet($ch['channel_id'],array('file' => array($sync))); } } @@ -254,7 +255,7 @@ class File extends DAV\Node implements DAV\IFile { $sync = attach_export_data($c[0],$this->data['hash']); if($sync) - build_sync_packet($c[0]['channel_id'],array('file' => array($sync))); + Libsync::build_sync_packet($c[0]['channel_id'],array('file' => array($sync))); } @@ -378,7 +379,7 @@ class File extends DAV\Node implements DAV\IFile { if($ch) { $sync = attach_export_data($ch, $this->data['hash'], true); if($sync) - build_sync_packet($ch['channel_id'], array('file' => array($sync))); + Libsync::build_sync_packet($ch['channel_id'], array('file' => array($sync))); } } } -- cgit v1.2.3 From 2cb0cade7b41e1251fb90e857f690ec155a10c9e Mon Sep 17 00:00:00 2001 From: Zot Date: Wed, 6 May 2020 11:00:29 +0200 Subject: Revert "issue generating photo thumbnails when uploaded via davfs" This reverts commit 7a0d9a449492ff3b5ef97b997310ed26ec1f53e4. --- Zotlabs/Storage/File.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zotlabs/Storage/File.php') diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 68edde166..ee96363c4 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -121,6 +121,11 @@ class File extends DAV\Node implements DAV\IFile { logger('put file: ' . basename($this->name), LOGGER_DEBUG); $size = 0; + if ((! $this->auth->owner_id) || (! perm_is_allowed($this->auth->owner_id, $this->auth->observer, 'write_storage'))) { + logger('permission denied for put operation'); + throw new DAV\Exception\Forbidden('Permission denied.'); + } + // @todo only 3 values are needed $c = q("SELECT * FROM channel WHERE channel_id = %d AND channel_removed = 0 LIMIT 1", intval($this->auth->owner_id) -- cgit v1.2.3 From ea845aeacdaa00b35a86550d5f9b0d3fcd2b40d4 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 16 Aug 2020 16:29:00 -0700 Subject: issue with DAV - moveInto and variable scope --- Zotlabs/Storage/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Storage/File.php') diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index ee96363c4..76295d922 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -27,7 +27,7 @@ class File extends DAV\Node implements DAV\IFile { * * filename (string) * * filetype (string) */ - private $data; + public $data; /** * @see \\Sabre\\DAV\\Auth\\Backend\\BackendInterface * @var \\Zotlabs\\Storage\\BasicAuth $auth -- cgit v1.2.3