Opened 7 years ago
Last modified 3 years ago
#28628 closed Cleanup/optimization
Audit for and abolish all use of '\d' in URL patterns — at Initial Version
Reported by: | James Bennett | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Ad Timmering, security@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Now that we're in the 2.0 release cycle and Python 3 only, any examples or code in Django using a \d
in a regex URL pattern should be replaced with [0-9]
, as \d
on Python 3 matches any character with Unicode category [Nd], which is almost certainly not what people expect. Changing to explicit [0-9]
, perhaps with a note about why it should be preferred, would be better.
Note:
See TracTickets
for help on using tickets.