Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #1854: escaping_html.patch

File escaping_html.patch, 0.8 KB (added by timClicks, 3 years ago)
  • taexporthtml.py

    diff --git a/taexporthtml.py b/taexporthtml.py
    index 5a0d163..47577f0 100644
    a b  
    2424import os.path 
    2525from tautils import data_to_string, save_picture, image_to_base64 
    2626from gettext import gettext as _ 
     27from cgi import escape 
    2728 
    2829def save_html(self, tw, embed_flag=True): 
    2930    """ Either: Save canvas and code or pictures to HTML """ 
     
    114115        code += (self.html_glue['img'][0] + imgdata + \ 
    115116                 self.html_glue['img'][1]) 
    116117        code += self.html_glue['div'][0] 
    117         code += data_to_string(tw.assemble_data_to_save(False, True)) 
     118        code += escape(data_to_string(tw.assemble_data_to_save(False, True))) 
    118119        code += self.html_glue['div'][1] 
    119120 
    120121    if tw.running_sugar: