let say i have a text field that filled with the html tags, how should i 
use the represent for that?
*e.g.*
db.define_table('mail_queue', 
Field('mail_to', 'list:string'), 
Field('subject'), 
Field('messages', 'text'), 
Field('status'), 
format = lambda r: '%s - %s - %s' % (r.mail_to, r.subject, r.status) )

db.mail_queue.messages.represent = lambda value, field: XML(value, sanitize 
= False) if value else ''

what i want to achieve is the messages field show html tag work result, but 
sanitize = False will open a XSS attack, isn't it?

db.mail_queue.messages.represent = lambda value, field: XML(value, sanitize 
= True) if value else ''

sanitize = True will not shown the html tag work result, just the html tag.

any idea?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to