Changeset 13805 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 6 Apr 2016, 08:51:19 (9 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
r13135 r13805 19 19 from zope import schema 20 20 from waeup.ikoba.interfaces import ( 21 IIkobaObject, validate_id, 21 IIkobaObject, validate_id, validate_html, 22 22 ContextualDictSourceFactoryBase) 23 23 from waeup.ikoba.interfaces import MessageFactory as _ … … 98 98 title = _(u'Multilingual content in HTML format'), 99 99 required = False, 100 constraint=validate_html, 100 101 ) 101 102 -
main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py
r13803 r13805 142 142 return True 143 143 144 # Define a validation method for HTML fields 145 class NotHTMLValue(schema.ValidationError): 146 __doc__ = u"Style or script elements not allowed" 147 148 def validate_html(value): 149 if '<style' in value or '<script' in value: 150 raise NotHTMLValue(value) 151 return True 152 153 144 154 # Define a validation method for international phone numbers 145 155 class InvalidPhoneNumber(schema.ValidationError): … … 585 595 required = False, 586 596 default = default_html_frontpage, 597 constraint=validate_html, 587 598 ) 588 599
Note: See TracChangeset for help on using the changeset viewer.