2017 © Pedro Peláez
 

yii-extension yii-email-obfuscator

Yii extension to obfuscate eMail addresses.

image

farmani/yii-email-obfuscator

Yii extension to obfuscate eMail addresses.

  • Saturday, September 13, 2014
  • by farmani
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii-email-obfuscator

Email obfuscatior plugin for Yii., (*1)

This plugin combines some Email obfuscation technics., (*2)

  • The @ char is removed and only its index is passed on. It will be reinserted using the expression String.fromCharCode(422*4).
  • The address itself will be transmitted as a ROT13 transformed string which will be retransformed by Javascript.
  • The "mailto:" prefix is decoded as a reversed string which gets unreversed by Javascript.

The Email address "mail@example.com" will result in the following code:, (*3)

<script type="text/javascript">
var action=":otliam".split("").reverse().join("");
var href="znvyrknzcyr.pbz".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});
href=href.substr(0, 4) + String.fromCharCode(4*2*2*4) + href.substr(4);
var a = "<a href=\""+action+href+"\">"+href+"</a>";
document.write(a);
</script>

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require "farmani/yii-email-obfuscator" "dev-master"

or add, (*6)

"farmani/yii-email-obfuscator": "dev-master"

to the require section of your composer.json file., (*7)

Usage

Simply insert this in your template:, (*8)

<?= Yii::app()->obfuscator->disguise('email@example.com',true); ?>

The Versions

13/09 2014

dev-master

9999999-dev https://github.com/farmani/yii-email-obfuscator

Yii extension to obfuscate eMail addresses.

  Sources   Download

BSD-3-Clause

The Requires

 

email extension yii obfuscation obfuscator