#2488: Encode email "mailto:"; links (Fix #2220)
-----------------------------+----------------------------------------------
  Reporter:  aspenwebdesign  |       Owner:                      
      Type:  Bug             |      Status:  new                 
  Priority:  Normal          |   Milestone:                      
 Component:  General         |     Version:  FCKeditor 2.6.3 Beta
Resolution:                  |    Keywords:  Confirmed IE        
-----------------------------+----------------------------------------------
Changes (by bestis):

 * cc: bestis (added)


Comment:

 Tested following patch. Should fix MSIE.
 Dunno why regexp's has start-of-line and end-of-line, so left them alone
 and did it with two regexps
 which will support the old and the new way.

 {{{
 --- /fckeditor/editor/dialog/fck_link/fck_link.js   2008-08-26
 11:32:20.000000000 +0300
 +++ fck_link.js 2008-10-02 15:45:07.000000000 +0300
 @@ -194,7 +194,11 @@
                 }

                 // Try to match the email against the encode protection.
 -               var aMatch = aLinkInfo[2].match(
 /^location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'$/ ) ;
 +               var aMatch = aLinkInfo[2].match(
 /^void\(location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'\)$/
 ) ;
 +               if ( !aMatch )
 +               {
 +                       var aMatch = aLinkInfo[2].match(
 /^location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'$/ ) ;
 +               }
                 if ( aMatch )
                 {
                         // The link is encoded
 @@ -253,7 +257,7 @@
                         for ( var i = 0 ; i < address.length ; i++ )
                                 aAddressCode.push( address.charCodeAt( i )
 ) ;

 -                       return
 'javascript:location.href=\'mailto:\'+String.fromCharCode(' +
 aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\'' ;
 +                       return
 'javascript:void(location.href=\'mailto:\'+String.fromCharCode(' +
 aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\')' ;
         }

         // EMailProtection 'none'
 }}}

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/2488#comment:5>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to