mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
Disallow backslashes in stylesheets. Work-around for bug in cssutils related to greedy parsing of them.
This commit is contained in:
@@ -240,7 +240,7 @@ def validate_css(string):
|
||||
return ('',ValidationReport())
|
||||
|
||||
report = ValidationReport(string)
|
||||
|
||||
|
||||
# avoid a very expensive parse
|
||||
max_size_kb = 100;
|
||||
if len(string) > max_size_kb * 1024:
|
||||
@@ -248,6 +248,9 @@ def validate_css(string):
|
||||
% dict (max_size = max_size_kb))))
|
||||
return (string, report)
|
||||
|
||||
if '\\' in string:
|
||||
report.append(ValidationError(_("if you need backslashes, you're doing it wrong")))
|
||||
|
||||
try:
|
||||
parsed = p.parseString(string)
|
||||
except DOMException,e:
|
||||
|
||||
Reference in New Issue
Block a user