Skip to content

Commit a97f5ff

Browse files
committed
fix: treated as false if there is a newline at the end for integer rule.
1 parent a4419a8 commit a97f5ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system/Validation/FormatRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function hex(?string $str = null): bool
147147
*/
148148
public function integer(?string $str = null): bool
149149
{
150-
return (bool) preg_match('/^[\-+]?[0-9]+$/', $str);
150+
return (bool) preg_match('/\A[\-+]?[0-9]+\z/', $str);
151151
}
152152

153153
/**

0 commit comments

Comments
 (0)