Skip to content

Validate the commercial week range before conversion - #188

Merged
nobu merged 1 commit into
ruby:masterfrom
nobu:cweek-range-check
Aug 28, 2026
Merged

Validate the commercial week range before conversion#188
nobu merged 1 commit into
ruby:masterfrom
nobu:cweek-range-check

Conversation

@nobu

@nobu nobu commented Aug 28, 2026

Copy link
Copy Markdown
Member

Reject week numbers outside -53..-1 and 1..53 before conversion so integer overflow cannot make invalid input appear valid.

Fixes #180.

Reject week numbers outside -53..-1 and 1..53 before conversion so
integer overflow cannot make invalid input appear valid.

Fixes ruby#180.
@nobu
nobu merged commit 1f3d54d into ruby:master Aug 28, 2026
30 checks passed
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.

Date.valid_commercial? accepts out-of-range week numbers, and Date.commercial then returns a wrong date

1 participant