Fix User Date of Birth Validation and Processing #16620
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Replace usage of
strtotime
withDateTimeImmutable::createFromFormat
for better format compatibility.Why is it needed?
Certain date formats, such as m-d-Y, are incompatible with
strtotime
and will cause the value of input fields where it's currently used (such as in a User's Profile) to fail.How to test
Set the system setting
manager_date_format
tom-d-Y
(or any other format where the month and day would be programmatically ambiguous), clear caches, and verify that a User's DOB can be added/updated as expected. Note that there are two distinct places to check this: under Manage/Users/[User] and via the logged in User's Profile page (at/manager/?a=security/profile
)Related issue(s)/PR(s)
n/a