Skip to content

Commit 51adf2c

Browse files
committed
Add coverage
1 parent b41ca4c commit 51adf2c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Security/Voter/AssetVoter.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ 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-
}
45-
return hash_equals($asset->getHash(), $hash);
41+
return $hash !== '' && hash_equals($asset->getHash(), $hash);
4642
}
4743
}

0 commit comments

Comments
 (0)