make html sanitize more tolerant for strange HTML code

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3916 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-07-06 19:27:59 +00:00
parent 3198c77746
commit afb4222532

View file

@ -60,9 +60,12 @@ def sanitizeStyle(value, validStyles=validStyles):
result = []
for item in value.split(';'):
if ':' in item:
k, v = item.split(':')
if checkStyle(k):
result.append(item.strip())
#k, v = item.split(':')
parts = item.split(':')
if len(parts) == 2:
k, v = parts
if checkStyle(k):
result.append(item.strip())
return '; '.join(result)
def checkStyle(k):