Stop changing symlink mime to target mime when saving

This commit is contained in:
nathan 2023-06-14 13:29:35 -06:00
parent b8b5601b48
commit 3a54a93eb3

View File

@ -720,7 +720,8 @@ 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 "<p>Vfs::nime_content_type($url_to,true) = $new_mime</p>\n";
$stmt = self::$pdo->prepare('UPDATE ' . self::TABLE . ' SET fs_mime=:fs_mime WHERE fs_id=:fs_id');