Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

transform script tag content to lowercase

  • Loading branch information...
commit 236c4860604f0de89364daaa743d884811a20010 1 parent 9565ca8
@originell authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 bleach/sanitizer.py
View
4 bleach/sanitizer.py
@@ -84,7 +84,7 @@ def sanitize_token(self, token):
basestring)):
self.skip_token = False
# This might be too dumb.
- elif any([keyw in self.previous_token['data']
+ elif any([keyw in self.previous_token['data'].lower()
for keyw in ('"', "'", 'var', ';', '=', '{',
'}', '[', ']', '++', '--', '+=',
'-=', '*=', '/=', '%=', 'return',
@@ -97,7 +97,7 @@ def sanitize_token(self, token):
# Detect if we have finished stripping a <script> tag and it's
# contents.
elif (self.strip_scripts and self.skip_token and
- 'name' in self.previous_token and
+ 'name' in self.previous_token and
'script' in self.previous_token['name'] and
self.previous_token['type'] == 4 and
token['type'] == 3):
Please sign in to comment.
Something went wrong with that request. Please try again.