Skip to content

Commit fc49b72

Browse files
committed
Replace ctype_digit for php 8.1 deprecation of non-string arguments
1 parent 464abe1 commit fc49b72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/src/Webhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function verify($payload, $headers)
7070

7171
public function sign($msgId, $timestamp, $payload)
7272
{
73-
$is_positive_integer = ctype_digit($timestamp);
73+
$is_positive_integer = is_numeric($timestamp) && (int) $timestamp == $timestamp && (int) $timestamp > 0;
7474
if (!$is_positive_integer) {
7575
throw new Exception\WebhookSigningException("Invalid timestamp");
7676
}

0 commit comments

Comments
 (0)