Changeset 623


Ignore:
Timestamp:
12/27/06 14:54:46 (11 years ago)
Author:
ray
Message:

Ticket #893
GetHtml: config.only7BitPrintablesInURLs not working properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/GetHtml/get-html.js

    r601 r623  
    8181                sHtml = sHtml.replace(c[13],'$1'+this.stripBaseURL(RegExp.$3)+'"'); 
    8282        } 
    83         if(this.config.only7BitPrintablesInURLs && c[13].test(sHtml)) { 
    84           sHtml = sHtml.replace(c[13], '$1'+RegExp.$3.replace(/([^!-~]+)/g,function(chr){return escape(chr);})+'"'); 
     83        if(this.config.only7BitPrintablesInURLs) { 
     84                if (HTMLArea.is_ie) c[13].test(sHtml); // oddly the test below only triggers when we call this once before (IE6), in Moz it fails if tested twice 
     85                if ( c[13].test(sHtml)) { 
     86                        try { //Mozilla returns an incorrectly encoded value with innerHTML 
     87                                sHtml = sHtml.replace(c[13], '$1'+decodeURIComponent(RegExp.$3).replace(/([^!-~]+)/g,function(chr){return escape(chr);})+'"'); 
     88                        } catch (e) { // once the URL is escape()ed, you can't decodeURIComponent() it anymore 
     89                                sHtml = sHtml.replace(c[13], '$1'+RegExp.$3.replace(/([^!-~]+)/g,function(chr){return escape(chr);})+'"'); 
     90                        } 
     91                } 
    8592        } 
    8693        return sHtml; 
Note: See TracChangeset for help on using the changeset viewer.