2016
This commit is contained in:
parent
dcaad31def
commit
972a342ba4
@ -22,12 +22,12 @@ function processInput($input) {
|
||||
|
||||
// Step 2: Filter only 17 digits long strings
|
||||
if (preg_match('/^\d{17}$/', $cleanedInput)) {
|
||||
// Step 3: Check if the first four digits are within 2007-2025
|
||||
// Step 3: Check if the first four digits are within 2006-2025
|
||||
$firstFourDigits = substr($cleanedInput, 0, 4);
|
||||
if ($firstFourDigits >= 2007 && $firstFourDigits <= 2025) {
|
||||
if ($firstFourDigits >= 2006 && $firstFourDigits <= 2025) {
|
||||
return ['valid' => $cleanedInput];
|
||||
} else {
|
||||
return ['invalid' => $cleanedInput, 'reason' => 'First four digits are not within 2007-2025'];
|
||||
return ['invalid' => $cleanedInput, 'reason' => 'First four digits are not within 2006-2025'];
|
||||
}
|
||||
} else {
|
||||
return ['invalid' => $cleanedInput, 'reason' => 'Not 17 digits long'];
|
||||
|
Loading…
Reference in New Issue
Block a user