Skip to content

Replace all instances of \d with [0-9] in regular expressions#27

Merged
oalders merged 2 commits into
libwww-perl:masterfrom
robrwo:rrwo/ASCII-dates-only
Jun 25, 2026
Merged

Replace all instances of \d with [0-9] in regular expressions#27
oalders merged 2 commits into
libwww-perl:masterfrom
robrwo:rrwo/ASCII-dates-only

Conversation

@robrwo

@robrwo robrwo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This hardens the date parsing to ensure that only ASCII dates are parsed. Otherwise Unicode digits will be accepted, but improperly parsed as 0.

This hardens the date parsing to ensure that only ASCII dates are
parsed.  Otherwise Unicode digits will be accepted, but improperly
parsed as 0.
@oalders
oalders force-pushed the rrwo/ASCII-dates-only branch from 9a4f4bc to d1bc7a0 Compare June 25, 2026 14:10
Verifies that dates written with non-ASCII Unicode digits (e.g.
Arabic-Indic U+0660..U+0669) are rejected rather than coerced to 0.
Guards the \d -> [0-9] hardening in str2time/parse_date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@oalders oalders left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @robrwo!

@oalders
oalders merged commit e45e4ca into libwww-perl:master Jun 25, 2026
49 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.

2 participants