Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PICARD-2712: Fix sanitize date removing 0 values #2283

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

phw
Copy link
Member

@phw phw commented Aug 17, 2023

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

Sanitize date cleared zero values in between, such turning "YYYY-00-DD" into "YYYY-DD", which would be a completely different date.

Solution

Fix this by keeping empty values if they are not the last element.

It changes the behavior for some strings with e.g. double slashes, as the empty string in between those is now considered a valid value and treated as 0.

Sanitize date cleared zero values in between, such turning "YYYY-00-DD"
into "YYYY-DD", which would be a completely different date.

Fix this by keeping empty values if they are not the last element.
@phw phw requested a review from zas August 17, 2023 06:42
Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

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

Good improvement

@phw phw merged commit ddda49c into metabrainz:master Aug 17, 2023
63 checks passed
@phw phw deleted the PICARD-2712-fix-sanitize-date branch September 11, 2023 11:03
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.

2 participants