1
jtessier72
Re: module.textsanitizer.php hack for encrypting email addresses
  • 2005/9/7 22:25

  • jtessier72

  • Just popping in

  • Posts: 3

  • Since: 2005/5/18


Trying to come up with something for the xoopscode emails which comes up a little later in module.textsanitizer.php

$replacements[] = '<a href="mailto:\1">\1</a>';


replace with:

$replacements[] = "<script type="text/javascript">var em='\1';document.write('<a href="mailto:'+em+'">'+em+'</a>');</script>";



Look good?



2
jtessier72
Re: Hide my email address from spiders.
  • 2005/5/18 4:06

  • jtessier72

  • Just popping in

  • Posts: 3

  • Since: 2005/5/18


I just posted something on another topic which relates to this thread.

Let me know if you find it works for you or if you can improve on it.



3
jtessier72
Re: Cloaking email addresses to prevent harvesting
  • 2005/5/18 3:54

  • jtessier72

  • Just popping in

  • Posts: 3

  • Since: 2005/5/18


I know this solution isn't ideal, but something is better than nothing. The '@', the '.' and the 'mailto:' get encoded. It should apply to all modules as well.

I'd appreciate comments on this - just learning PHP as I go. Ideally I'll only execute this if it's a mailto: link.

Edit the end of the &xoopsCodeDecode function in class/module.textsanitizer.php

$output preg_replace($patterns$replacements$text);
        
$output str_replace('@''&X64;'$output);
        
$output str_replace('.''&X46;'$output);
        
$output str_replace('mailto:''&X109;&X97;&X105;&X108;&X116;&X111;&X58;'$output);
        return 
$output;

        
//return preg_replace($patterns, $replacements, $text);


In this example, you get the following for user@host.com:

<a href="&X109;&X97;&X105;&X108;&X116;&X111;&X58;user&X64;host&X46;com">user&X64 ;host&X46 ;com</a>


Replace &X with &# to get the right results.




TopTop



Login

Who's Online

198 user(s) are online (147 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits