Skip to content

Bug fixes and improvements#4

Open
rimi-itk wants to merge 7 commits into
developfrom
features/bug-fixes-and-clean-up
Open

Bug fixes and improvements#4
rimi-itk wants to merge 7 commits into
developfrom
features/bug-fixes-and-clean-up

Conversation

@rimi-itk

@rimi-itk rimi-itk commented Jan 13, 2021

Copy link
Copy Markdown
  • Fixes issue with only first 10 digit number in text being used to decide if the text contains a valid Danish CPR number.
  • Cleans up CprValidator class by adding more meaningful functions names and deprecating checkCpr function..
  • Adds function, extractCpr, to extract CPR numbers from a text.

@rimi-itk rimi-itk requested a review from cableman January 13, 2021 15:13
@rimi-itk rimi-itk force-pushed the features/bug-fixes-and-clean-up branch from 20f352f to b4673e5 Compare January 14, 2021 08:27
Comment thread src/CprValidator.php Outdated
$month = substr($cpr, 2, 2);
$year = substr($cpr, 4, 2);

$prefix = (int) $year < 21 ? '20' : '19';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the 7th digit to determine the century as per the cpr specs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghbm-itk, I've lifted your code in bf1615e.

@rimi-itk rimi-itk requested a review from ghbm-itk July 10, 2026 12:06
@rimi-itk rimi-itk force-pushed the features/bug-fixes-and-clean-up branch 6 times, most recently from 1b0220f to 03a8579 Compare July 10, 2026 12:34
@rimi-itk rimi-itk force-pushed the features/bug-fixes-and-clean-up branch from 03a8579 to 348f6ad Compare July 10, 2026 12:36
@rimi-itk rimi-itk force-pushed the features/bug-fixes-and-clean-up branch from f01d80b to 8aa79a3 Compare July 10, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants