Repository navigation
Commit 10fcc2b
committed
fix: reject non-digit characters in valid_cc_number()
Use ctype_digit() instead of is_numeric() so values such as decimal
points, which is_numeric() accepts, can no longer reach the Luhn check.
Previously a string like '5351367.37861108' passed validation and the
Luhn indexer triggered an 'Undefined array key' warning on non-digit
characters.1 parent c21d575 commit 10fcc2b
2 files changed
Lines changed: 11 additions & 1 deletion
File tree
- system/Validation
- tests/system/Validation/StrictRules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
0 commit comments