email masking

Welcome to the WonderCMS community. Anything goes, except for support requests.
Post Reply
Posts: 2
Joined: Thu Feb 19, 2015 10:44 am

email masking

Post by bas »


I tried the following to hide email addresses on the website.
Maybe it is useful to someone, maybe someone has a better suggestion for accomplishing the same.
At the end is the code I inserted in edit text.php to replace "mailto" and "@" with the same characters in ASCII
In the browser nothing seems to have changed, but if you look at the source, the address cannot be found anymore.


Code: Select all

$content = trim(rtrim(stripslashes($_REQUEST['content']))); //This line is already in editText.php

$from = array("@"    ,"?"    ,"."    ,"mailto:"                                 ,"subject=");
$to   = array("@","?",".","mailto:","subject=");
$content = str_replace($from, $to, $content);
Post Reply