Add r string literal for regexps
This commit is contained in:
parent
43f833e604
commit
62401b24ec
4 changed files with 27 additions and 26 deletions
|
@ -312,7 +312,7 @@ class UiRequest(object):
|
|||
extra_headers = {}
|
||||
script_nonce = self.getScriptNonce()
|
||||
|
||||
match = re.match("/(?P<address>[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
match = re.match(r"/(?P<address>[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
just_added = False
|
||||
if match:
|
||||
address = match.group("address")
|
||||
|
@ -525,7 +525,7 @@ class UiRequest(object):
|
|||
if ".." in path or "./" in path:
|
||||
raise SecurityError("Invalid path")
|
||||
|
||||
match = re.match("/media/(?P<address>[A-Za-z0-9]+[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
match = re.match(r"/media/(?P<address>[A-Za-z0-9]+[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
if match:
|
||||
path_parts = match.groupdict()
|
||||
path_parts["request_address"] = path_parts["address"] # Original request address (for Merger sites)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue