Skip to content

Commit a38636e

Browse files
committed
ctype_digit
1 parent f3b4675 commit a38636e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/lib/utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function getHyperlink($text, ...$url_components)
8989
*/
9090
function str2int(string $x, ...$args): int
9191
{
92-
if (preg_match("/^[0-9]+$/", $x)) {
92+
if (ctype_digit($x)) {
9393
return intval($x, ...$args);
9494
} else {
9595
throw new ValueError("not digits: $x");

0 commit comments

Comments
 (0)