Skip to content

Commit 6ba84e3

Browse files
committed
Revert "Reverse hash_equals parameters (#4733)"
see #4733 (comment) This reverts commit c769746.
1 parent c769746 commit 6ba84e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reference/hash/functions/hash-equals.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ $secretKey = '8uRhAeH89naXfFXKGOEj';
7676
$value = 'username=rasmuslerdorf';
7777
$signature = '8c35009d3b50caf7f5d2c1e031842e6b7823a1bb781d33c5237cd27b57b5f327';
7878
79-
if (hash_equals($signature, hash_hmac('sha256', $value, $secretKey))) {
79+
if (hash_equals(hash_hmac('sha256', $value, $secretKey), $signature)) {
8080
echo "The value is correctly signed.", PHP_EOL;
8181
} else {
8282
echo "The value was tampered with.", PHP_EOL;

0 commit comments

Comments
 (0)