1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

more strict comparison

This commit is contained in:
Damodar Lohani 2021-11-07 11:36:18 +05:45
parent b68311755f
commit cad73af84d

View file

@ -738,7 +738,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
$file = $dbForInternal->getDocument('bucket_' . $bucketId, $fileId);
if ($file->isEmpty() || $file->getAttribute('bucketId') != $bucketId) {
if ($file->isEmpty() || $file->getAttribute('bucketId') !== $bucketId) {
throw new Exception('File not found', 404);
}
$usage
@ -813,7 +813,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$file = $dbForInternal->getDocument('bucket_' . $bucketId, $fileId);
if ($file->isEmpty() || $file->getAttribute('bucketId') != $bucketId) {
if ($file->isEmpty() || $file->getAttribute('bucketId') !== $bucketId) {
throw new Exception('File not found', 404);
}
@ -945,7 +945,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
$file = $dbForInternal->getDocument('bucket_' . $bucketId, $fileId);
if ($file->isEmpty() || $file->getAttribute('bucketId') != $bucketId) {
if ($file->isEmpty() || $file->getAttribute('bucketId') !== $bucketId) {
throw new Exception('File not found', 404);
}
@ -1019,7 +1019,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
$file = $dbForInternal->getDocument('bucket_' . $bucketId, $fileId);
$mimes = Config::getParam('storage-mimes');
if ($file->isEmpty() || $file->getAttribute('bucketId') != $bucketId) {
if ($file->isEmpty() || $file->getAttribute('bucketId') !== $bucketId) {
throw new Exception('File not found', 404);
}
@ -1162,7 +1162,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
$file = $dbForInternal->getDocument('bucket_' . $bucketId, $fileId);
if ($file->isEmpty() || $file->getAttribute('bucketId') != $bucketId) {
if ($file->isEmpty() || $file->getAttribute('bucketId') !== $bucketId) {
throw new Exception('File not found', 404);
}