Skip to content

Commit

Permalink
Fix: Escape unwanted regex chars (fixes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0md3v authored Sep 1, 2021
1 parent d876b2f commit c8fb124
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uro/uro.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def is_content(path: str) -> bool:
"""
if path.count('-') > 3:
new_parts = []
for part in path.split('/'):
for part in re.escape(path).split('/'):
if part.count('-') > 3:
new_parts.append('[^/]+')
else:
Expand All @@ -78,7 +78,7 @@ def create_pattern(path: str) -> str:
creates patterns for urls with integers in them
"""
new_parts = []
for part in path.split('/'):
for part in re.escape(path).split('/'):
if part.isdigit():
new_parts.append('\\d+')
else:
Expand Down

0 comments on commit c8fb124

Please sign in to comment.