Fix regex it

This commit is contained in:
Joona Hoikkala 2019-12-13 17:47:16 +02:00
parent 88cb4c8547
commit 4127e2f6cb
No known key found for this signature in database
GPG key ID: D5AA86BBF9B29A5C

View file

@ -617,12 +617,13 @@ class ApacheParser(object):
"""
block_paths = [] # type: List[str]
# Find blocks in the middle of path as well as in the end
block = "/{}(/|$)".format(block)
# Not found
if block.lower() not in path.lower():
return block_paths
# Find blocks in the middle of path as well as in the end
block = "/{}(/|$)".format(block)
startidx = 0
found = re.search(block, path[startidx:], flags=re.IGNORECASE)
while found: