You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bcp47_strict_language_tag accepts repeated variant subtags forbidden by RFC5646 #1677
Expected: each fails validation. RFC5646 section2.2.5 item5 states “The same variant subtag MUST NOT be used more than once within a language tag” and explicitly identifies de-DE-1901-1901 as invalid: https://www.rfc-editor.org/rfc/rfc5646.html#section-2.2.5.
The current implementation validates each variant in isolation against the parser and registry but never checks whether an earlier variant in the same tag has already used it. The tag has already been lowercased, so case-insensitive duplicate tracking can stay local to that loop.
Reproduced on master a5843c6, Go1.27.3/Linuxamd64. Five negative subtests fail on current source; five controls with distinct variants or repeated private-use subtags pass. This report concerns only duplicate variants; other BCP47 behavior and the non-strict validator are outside its scope. No security impact is claimed.
AI disclosure: OpenAI GPT-6.1 (cpa/gpt-6.1-sol) via OpenClaw performed source analysis, reproduction, patch/test generation and drafted this report. Outputs were locally verified; no human code review is claimed.
Activity
fix: reject duplicate variants in strict BCP47 tags (go-playground#1678)