[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: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 2 additions and 2 deletions

View File

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