Changeset 39


Ignore:
Timestamp:
03/19/05 12:37:37 (14 years ago)
Author:
gogo
Message:

Appying patch #57 also changed other uses of escape() and unescape(). Not sure about changing
charset=UTF-8 as mentioned in #57, because while the characters will be percent-encoded as %xx%xx
they are still UTF-8, so it seems reasonable that the target server would want to be told that.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r38 r39  
    241241  if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/)) 
    242242    this.baseURL = RegExp.$1 + "/"; 
     243 
     244  // CharSet of the iframe, default is the charset of the document 
     245  this.charSet = HTMLArea.is_gecko ? document.characterSet : document.charset; 
    243246 
    244247  // URL-s 
     
    14141417      var html = "<html>\n"; 
    14151418      html += "<head>\n"; 
    1416       if(typeof editor.config.baseHref != 'undefined') 
    1417       { 
    1418         html += "<base href=\"" + editor.config.baseHref + "\"/>"; 
     1419      html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + editor.config.charSet + "\">\n"; 
     1420      if(typeof editor.config.baseHref != 'undefined' && editor.config.baseHref != null) 
     1421      { 
     1422        html += "<base href=\"" + editor.config.baseHref + "\"/>\n"; 
    14191423      } 
    14201424      html += "<style title=\"table borders\">" 
     
    43384342  for(var i in data) 
    43394343  { 
    4340     content += (content.length ? '&' : '') + i + '=' + escape(data[i]); 
     4344    if(typeof data[i] == 'function') continue; 
     4345    // http://worldtimzone.com/blog/date/2002/09/24 
     4346 
     4347    content += (content.length ? '&' : '') + i + '=' + encodeURIComponent(data[i]); 
    43414348  } 
    43424349 
  • trunk/plugins/Linker/linker.js

    r29 r39  
    101101          if(j) 
    102102          { 
    103             inputs[j[1]] = unescape(j[2]); 
     103            inputs[j[1]] = decodeURIComponent(j[2]); 
    104104          } 
    105105        } 
     
    193193      { 
    194194        atr.href = 'mailto:' + values.to + '?'; 
    195         if(values.subject) atr.href += 'subject=' + escape(values.subject); 
    196         if(values.body)    atr.href += (values.subject ? '&' : '') + 'body=' + escape(values.body); 
     195        if(values.subject) atr.href += 'subject=' + encodeURIComponent(values.subject); 
     196        if(values.body)    atr.href += (values.subject ? '&' : '') + 'body=' + encodeURIComponent(values.body); 
    197197      } 
    198198    } 
     
    369369      this.dTree.add(Linker.nxtid++, parent, 
    370370                     files[i].replace(/^.*\//, ''), 
    371                      'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=unescape(\'' + escape(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);', 
     371                     'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);', 
    372372                     files[i]); 
    373373    } 
Note: See TracChangeset for help on using the changeset viewer.