Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.

This commit is contained in:
Ad Timmering 2021-11-26 10:44:54 +09:00 committed by Mariusz Felisiak
parent fe76944269
commit bdf3e156b4
10 changed files with 35 additions and 17 deletions

View file

@ -246,8 +246,8 @@ following URL patterns which optionally take a page argument::
from django.urls import re_path
urlpatterns = [
re_path(r'^blog/(page-(\d+)/)?$', blog_articles), # bad
re_path(r'^comments/(?:page-(?P<page_number>\d+)/)?$', comments), # good
re_path(r'^blog/(page-([0-9]+)/)?$', blog_articles), # bad
re_path(r'^comments/(?:page-(?P<page_number>[0-9]+)/)?$', comments), # good
]
Both patterns use nested arguments and will resolve: for example,