fix: enisa-csirt-inventory meta_template uppercase country codes - #229
Open
DocArmoryTech wants to merge 1 commit into
Open
fix: enisa-csirt-inventory meta_template uppercase country codes#229DocArmoryTech wants to merge 1 commit into
DocArmoryTech wants to merge 1 commit into
Conversation
The `ISO 3166-1 Code` regex was lowercase-only:
"regex": "[a-z]{2,3}"
MetaFieldsTable::isValidRegex applies it as `/^[a-z]{2,3}$/m`, so the
uppercase form the standard actually specifies was rejected:
[a-z]{2,3} IE => false ie => true
[A-Za-z]{2,3} IE => true ie => true
ISO 3166-1 alpha-2 and alpha-3 codes are defined in uppercase, so the
convention most operators type was the one that failed.
Widened to `[A-Za-z]{2,3}` rather than `[A-Z]{2,3}` so any lowercase values
already stored remain valid.
Version bumped 3 -> 4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
ISO 3166-1 Codefield rejects the uppercase form that the standard actually specifies.{ "field": "ISO 3166-1 Code", "type": "text", "regex": "[a-z]{2,3}" }Applied as
/^[a-z]{2,3}$/m.IEieIRL[a-z]{2,3}[A-Za-z]{2,3}ISO 3166-1 alpha-2 and alpha-3 codes are defined in uppercase, so the convention most operators type is the one that fails.
Changes
[A-Za-z]{2,3}version3 → 4[A-Za-z]rather than[A-Z]so that any lowercase values already stored stay valid.