Changeset 4567


Ignore:
Timestamp:
06/01/11 14:40:34 (9 years ago)
Author:
brunocosta
Message:

Ticket #1948 - Mudado o escape de aspas simples na função set_messages_flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/expressoMail1_2/js/local_messages.js

    r4546 r4567  
    716716        if(Element("check_box_message_" + msgs_to_set[i])) 
    717717            Element("check_box_message_" + msgs_to_set[i]).checked = false; 
    718          
    719         for (var i in mail.thumbs) {  
    720                 /* 
    721                  * Os thumbs contêm aspas simples que impactam na sql.  
    722                  * Aqui eu substituo as aspas simples por duas simples(escape no sqlite), 
    723                  * Caso já venham duas juntas, elas continuam sem serem duplicadas. 
    724                  */ 
    725                 mail.thumbs[i] = mail.thumbs[i].replace(/([^'])'([^'])('?)/g,"$1''$2$3$3"); 
    726         } 
    727          
    728         this.dbGears.execute("update mail set mail='"+connector.serialize(mail)+"',header='"+connector.serialize(header)+ 
     718        var smail=connector.serialize(mail); 
     719        smail =smail.replace(/([^'])'([^'])('?)/g,"$1''$2$3$3"); 
     720        this.dbGears.execute("update mail set mail='"+smail+"',header='"+connector.serialize(header)+ 
    729721                                                                "',unseen="+unseen+",flagged="+flagged+",answered="+answered+ 
    730722                                                                " where rowid="+msgs_to_set[i]); 
Note: See TracChangeset for help on using the changeset viewer.