[pmwiki-users] Trivial eProtect suggestion

Simon s-i-m-o-n at paradise.net.nz
Sat May 7 19:10:02 CDT 2005


The best way to protect email addresses properly is to only build them
on the client side using a script.
(email harvesters are unlikely to go to effort of interpreting a javascript)

For a trivial eProtect I'd like to have
* PmWiki generate a call to a javascript routine for every mailto link it generates
* This is instead of <a
href="mailto:emailName at emailAddress?Subject=subJect">linkName</a>
* every mailto: encountered generates a call to a javascript routine when the HTML is
built, eg
* <script language="JavaScript" type=" type="text/javascript">eProtect
("emailName","emailAddress","subJect","linkName")</script>

* where the javascript routine is

  function eProtect (emailName,emailAddress,subJect,linkName)
  {
  document.write ('<a href="mailto:', emailName, '&#64;', emailAddress);
  if (subJect != '') {
   document.write ('?subject=', subJect);
   }
  document.write ('">', linkName, '</a>');
  }

* it is easy to include in the page template a call to a include a javascript library of routines, 
eg in the <head> add
* <script type="text/javascript" src="/pmwiki.js"
language="JavaScript"></script>

* I don't want to see them munged in the wiki.d files, and simply
changing them to character entities may help, but is really trivial to
overcome and provides no protection!

Simon











More information about the pmwiki-users mailing list