[parsing] support uppercase SCRIPT tags as suggested by github-advanced-security bot

This commit is contained in:
flashdagger 2023-11-13 06:54:28 +01:00
parent b35550248a
commit c34166d7c8
No known key found for this signature in database
GPG key ID: 0A82E44224B28001
2 changed files with 2 additions and 2 deletions

View file

@ -345,7 +345,7 @@ def mark_comments(_string, char='^', nochar='-'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
here is <!-- a comment --> and <!-- another comment --> end
----------------^^^^^^^^^^^----------------^^^^^^^^^^^^^^^^^---------
<script> ignore here </script> <script> and here </script>
<script> ignore here </script> <SCRIPT> and here </SCRIPT>
--------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^---------
'''

View file

@ -20,7 +20,7 @@ class HTMLIgnoreRanges:
if offset in ranges:
...
"""
REGEX = re.compile(r'<!--|-->|</?\s*(?:script|style)\b[^>]*>')
REGEX = re.compile(r'<!--|-->|</?\s*(?:script|style)\b[^>]*>', flags=re.IGNORECASE)
def __init__(self, html):
self.html = html