Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError raised on invalid data URI in sanitizer #188

Closed
papachoco opened this issue Apr 30, 2015 · 2 comments
Closed

AttributeError raised on invalid data URI in sanitizer #188

papachoco opened this issue Apr 30, 2015 · 2 comments

Comments

@papachoco
Copy link

While trying to sanitize u'<html><body><audio controls="" src="data:foobar"></audio></body></html>'

I get an AttributeError exception In HTMLSanitizerMixin line 218

215: m = content_type_rgx.match(uri.path)
216: if not m:
217:      del attrs[attr]
218: if m.group('content_type') not in self.allowed_content_types:
             del attrs[attr]

Line 215 returns None , but in line 218 m is assumed to be None

Carlos

@gsnedders gsnedders changed the title AttributeError: 'NoneType' object has no attribute 'group' AttributeError raised on invalid data URI in sanitizer Apr 30, 2015
@gsnedders gsnedders self-assigned this Apr 30, 2015
@gsnedders
Copy link
Member

0.99999 now shipped with that running through the sanitizer without it dying now.

@papachoco
Copy link
Author

Thanks a lot

On Thu, Apr 30, 2015 at 3:02 PM, Geoffrey Sneddon [email protected]
wrote:

0.99999 now shipped with that running through the sanitizer without it
dying now.


Reply to this email directly or view it on GitHub
#188 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants