From 3a54a93eb3d5a06afcf1650782d51e11d8c49986 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 14 Jun 2023 13:29:35 -0600 Subject: [PATCH] Stop changing symlink mime to target mime when saving --- api/src/Vfs/Sqlfs/StreamWrapper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/Vfs/Sqlfs/StreamWrapper.php b/api/src/Vfs/Sqlfs/StreamWrapper.php index 59b182cc96..937f643990 100644 --- a/api/src/Vfs/Sqlfs/StreamWrapper.php +++ b/api/src/Vfs/Sqlfs/StreamWrapper.php @@ -720,10 +720,11 @@ class StreamWrapper extends Api\Db\Pdo implements Vfs\StreamWrapperIface // check if extension changed and update mime-type in that case (as we currently determine mime-type by it's extension!) // fixes eg. problems with MsWord storing file with .tmp extension and then renaming to .doc - if ($ok && ($new_mime = Vfs::mime_content_type($url_to,true)) != Vfs::mime_content_type($url_to)) + if($ok && (!$from_stat['mime'] || $from_stat['mime'] != self::SYMLINK_MIME_TYPE) && + ($new_mime = Vfs::mime_content_type($url_to, true)) != Vfs::mime_content_type($url_to)) { //echo "

Vfs::nime_content_type($url_to,true) = $new_mime

\n"; - $stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_mime=:fs_mime WHERE fs_id=:fs_id'); + $stmt = self::$pdo->prepare('UPDATE ' . self::TABLE . ' SET fs_mime=:fs_mime WHERE fs_id=:fs_id'); $stmt->execute(array( 'fs_mime' => $new_mime, 'fs_id' => $from_stat['ino'],