Skip to content

Commit b41ca4c

Browse files
frankdekkerCopilot
andauthored
Update src/Security/Voter/AssetVoter.php
Co-authored-by: Copilot <[email protected]>
1 parent 2eb5df7 commit b41ca4c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Security/Voter/AssetVoter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ protected function voteOnAttribute(string $attribute, mixed $subject, TokenInter
3838
$hash = Assert::notNull($this->requestStack->getCurrentRequest())->query->getString('hash');
3939
$asset = Assert::isInstanceOf($subject, Asset::class);
4040

41+
// Validate that the hash parameter is not empty before comparison
42+
if ($hash === '' || $hash === null) {
43+
return false;
44+
}
4145
return hash_equals($asset->getHash(), $hash);
4246
}
4347
}

0 commit comments

Comments
 (0)