diff options
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/index.php b/public/index.php index 265a03e..d09aeab 100644 --- a/public/index.php +++ b/public/index.php @@ -102,6 +102,15 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) { exit; } + if (IS_JSON_REQUEST) { + unset($file['password']); + $file['urls'] = [ + 'download_url' => INSTANCE_ORIGINAL_URL . "/{$file['id']}.{$file['extension']}" + ]; + json_response($file, null); + exit; + } + $file['full_url'] = FILE_UPLOAD_DIRECTORY_PREFIX . "/{$file['id']}.{$file['extension']}"; // formatting the file size |
