Added tighter controls for matching log ID and item_id

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2023-10-09 15:17:03 +01:00
parent d2dc3253ab
commit e5f5802235
6 changed files with 17 additions and 16 deletions
@@ -137,7 +137,7 @@ class LicenseFilesController extends Controller
$this->authorize('view', $license);
$this->authorize('licenses.files', $license);
if (! $log = Actionlog::find($fileId)) {
if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $license->id)->first()) {
return response('No matching record for that asset/file', 500)
->header('Content-Type', 'text/plain');
}