diff --git a/docs/changelogs/v4.7.7.md b/docs/changelogs/v4.7.7.md index 121dae00153c..98917f893962 100644 --- a/docs/changelogs/v4.7.7.md +++ b/docs/changelogs/v4.7.7.md @@ -50,6 +50,7 @@ Release Date: Unreleased - **Session:** Fixed a bug where `BaseHandler::destroyCookie()` did not send the `SameSite` attribute in the `Set-Cookie` header, which could prevent browsers from properly clearing the session cookie. - **Session:** Fixed a bug where `MemcachedHandler` did not reset lock state in `close()` or release an existing lock for a different session ID in `lockSession()`, causing subsequent reads and session ID regeneration on the same handler instance to fail. - **Session:** Fixed a bug where `Session::start()` did not remove an invalid session cookie from `Request`'s cached cookie global if cookies had already been read from `Request`. +- **Validation:** Fixed a bug where `valid_cc_number` rejected valid Discover cards starting with `646` due to a typo in the prefixes list (`656` instead of `646`). - **Worker Mode:** Fixed a bug where every request that ended with an uncaught exception, including a `404 Page Not Found` without a 404 override, called `exit()` in the exception handler. This ended the worker script, so FrankenPHP booted a new one, and the worker loop skipped its cleanup after the request. The exception handler now returns to the worker loop. See the repo's [CHANGELOG.md](https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md) for a complete list of bugs fixed. diff --git a/system/Validation/CreditCardRules.php b/system/Validation/CreditCardRules.php index e270a6ba9f78..e27d9c59e1b7 100644 --- a/system/Validation/CreditCardRules.php +++ b/system/Validation/CreditCardRules.php @@ -66,7 +66,7 @@ class CreditCardRules 'Discover Card' => [ 'name' => 'discover', 'length' => '16,19', - 'prefixes' => '6011,622,644,645,656,647,648,649,65', + 'prefixes' => '6011,622,644,645,646,647,648,649,65', 'checkdigit' => true, ], 'InterPayment' => [ diff --git a/tests/system/Validation/StrictRules/CreditCardRulesTest.php b/tests/system/Validation/StrictRules/CreditCardRulesTest.php index 55a880839662..f8c15bb74dfa 100644 --- a/tests/system/Validation/StrictRules/CreditCardRulesTest.php +++ b/tests/system/Validation/StrictRules/CreditCardRulesTest.php @@ -460,6 +460,16 @@ public static function provideValidCCNumber(): iterable self::generateCardNumber(65, 19), true, ], + 'discover21' => [ + 'discover', + self::generateCardNumber(646, 16), + true, + ], + 'discover22' => [ + 'discover', + self::generateCardNumber(646, 19), + true, + ], 'interpayment1' => [ 'interpayment', self::generateCardNumber(4, 16),