This add-on uses the following obfuscation method by default:
If this is not strong enough for you, you're free to write your own obfuscation method, guide is provided below.
If you want to use the rtl-obfuscation method you need to add the following to your site/config.php:
define('EMAIL_OBFUSCATION_METHOD', 'rtl');
This method works as follows:
The vigenere cipher obfuscation method is strong enough to fool any bots. Thanks to user mnakalay it is now available also for the Automatic Email Obfuscator! He was also one of the first people to put the extendable obfuscation method architecture to the test.
More information about the encryption algorithm is available from Wikipedia.
This method does not work without JavaScript!
If you want to use the Vigenere cipher method you need to add the following to your site/config.php:
define('EMAIL_OBFUSCATION_METHOD', 'vigenere');
If you believe the default obfuscation methods are not strong enough, don't worry. You're free to easily write your own. It is done by writing your own email obfuscator or overriding the old obfuscation classes.
It is suggested to write your own method at this point. This is done by adding your obfuscation class under /libraries/ and namig it "email_obfuscator_yourmethod.php".
The class should look something like this:
<?php Loader::library("email_obfuscator_default", "automatic_email_obfuscator"); class EmailObfuscatorYourmethod extends EmailObfuscatorDefault { public function on_page_view() { // Optional method } public function obfuscateMail($email) { // TODO: Write here the function to obfuscate mail addresses inside and outside links return $email; } public function obfuscateMailtoLinkHref($href) { // TODO: Write here your links mailto-link href obfuscation return str_replace("mailto:", "#", $href); } }
After you have written your obfuscator class, just add the following to your config/site.php:
define('EMAIL_OBFUSCATION_METHOD', 'yourmethod');
Please make sure that your file is named accordingly to your class name, so that EmailObfuscatorYourmethod would be stored in a file named email_obfuscator_yourmethod.php. Also, please ensure that this file can really be found from the libraries-folder, otherwise you will see a PHP error.
If your obfuscation method needs client side deobfuscation, you can do this by loading your javascript in the "on_page_view" method of your obfuscator class:
public function on_page_view() { $html = Loader::helper("html"); $v = View::getInstance(); $v->addHeaderItem($html->javascript("email_deobfuscator_yourmethod.js")); }
After adding this to your obfuscator you can easily write your deobfuscator js:
(function($){ $(document).ready(function() { $("a.obfuscated_link").deobfuscateEmailLink(); $("span.obfuscated_link_text").deobfuscateEmailLink(); }); $.fn.deobfuscateEmailLink = function() { $(this).each(function() { // TODO: Your deobfuscation method here }); }; })(jQuery);