mirror of
https://github.com/django/django.git
synced 2025-03-10 17:32:41 +00:00
Fixed #35250 -- Made URL system checks use uncompiled regexes.
This commit is contained in:
parent
5dfcf343cd
commit
71d5eafb05
@ -169,12 +169,11 @@ class CheckURLMixin:
|
|||||||
"""
|
"""
|
||||||
Check that the pattern does not begin with a forward slash.
|
Check that the pattern does not begin with a forward slash.
|
||||||
"""
|
"""
|
||||||
regex_pattern = self.regex.pattern
|
|
||||||
if not settings.APPEND_SLASH:
|
if not settings.APPEND_SLASH:
|
||||||
# Skip check as it can be useful to start a URL pattern with a slash
|
# Skip check as it can be useful to start a URL pattern with a slash
|
||||||
# when APPEND_SLASH=False.
|
# when APPEND_SLASH=False.
|
||||||
return []
|
return []
|
||||||
if regex_pattern.startswith(("/", "^/", "^\\/")) and not regex_pattern.endswith(
|
if self._regex.startswith(("/", "^/", "^\\/")) and not self._regex.endswith(
|
||||||
"/"
|
"/"
|
||||||
):
|
):
|
||||||
warning = Warning(
|
warning = Warning(
|
||||||
@ -224,8 +223,7 @@ class RegexPattern(CheckURLMixin):
|
|||||||
return warnings
|
return warnings
|
||||||
|
|
||||||
def _check_include_trailing_dollar(self):
|
def _check_include_trailing_dollar(self):
|
||||||
regex_pattern = self.regex.pattern
|
if self._regex.endswith("$") and not self._regex.endswith(r"\$"):
|
||||||
if regex_pattern.endswith("$") and not regex_pattern.endswith(r"\$"):
|
|
||||||
return [
|
return [
|
||||||
Warning(
|
Warning(
|
||||||
"Your URL pattern {} uses include with a route ending with a '$'. "
|
"Your URL pattern {} uses include with a route ending with a '$'. "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user