[CORE][GSFile] Allow storing files under /file

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-04 19:26:48 +01:00 committed by Hugo Sales
parent e688bf8aed
commit fb6aa78ae8
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -70,8 +70,8 @@ class GSFile
?string $title = null, ?string $title = null,
bool $is_local = true): Attachment bool $is_local = true): Attachment
{ {
if (!Formatting::startsWith($dest_dir, Common::config('attachments', 'dir'))) { if (!Formatting::startsWith($dest_dir, Common::config('storage', 'dir'))) {
throw new \InvalidArgumentException("Attempted to store an attachment to a folder outside the GNU social attachment location: {$dest_dir}"); throw new \InvalidArgumentException("Attempted to store a file in a directory outside the GNU social files location: {$dest_dir}");
} }
$hash = null; $hash = null;