Disallow backslashes in stylesheets. Work-around for bug in cssutils related to greedy parsing of them.

This commit is contained in:
ketralnis
2009-04-26 00:34:34 -07:00
parent 4ba2eb7398
commit 1d05efe34b

View File

@@ -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: