Search

An attempt to obfuscate an e-mail address to prevent it being picked up by spam harvesters. This template converts ASCII characters to their respective Hex variants, nothing more.

Usage

<xsl:call-template name="obfuscate-email">
    <xsl:with-param name="email" select="'email@domain.com'"/>
</xsl:call-template>

Output:

&#x0065&#x006d&#x0061&#x0069&#x006c&#x0040&#x0064&#x006f&#x006d&#x0061&#x0069&#x006e&#x002e&#x0063;&#x006f&#x006d

Download

http://symphony21.com/downloads/xslt/file/20574/

This is awesome, Nick. Thanks.

Can this be used to obfuscate the mailto-part in the anchor tag as well? I can’t find a way to do that.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details