| Gabriel Birke 2004-03-19, 1:29 pm |
| Hello!
I'm trying to obfuscate and "linkify" mail addresses in a text with the =20=
following modifier:
function smarty_modifier_mail_escape($string)
{
return =20
preg_replace_callback("/[_a-z0-9.A-Z]+@[-a-z0-9.A-=20
Z]+/","escape_mail",$string);
}
function escape_mail($text)
{
echo "escape_mail called";//<-- for debugging purposes, to test if =
=20
the func is called
$text=3D$text[0];
for($i=3D0;$i<strlen($text);$i++)
{
$mailto.=3D"".ord($text[$i]).";";
}
return "<a =20
href=3D\"mailto:$mailto\">$mailto</a>";
}
The two functions are in the same file but escape_mail doesn't get =20
called (Smarty 2.3, PHP 4.1). What am I doing wrong?
Is there another way to accomplish the obfuscation of email adresses =20
that are mingled with normal text?
With best regards
Gabriel Birke
--=20
KONTOR4_Neue Medien
Plathnerstra=DFe 5
30175 Hannover
Fax: +49 51184 48 98 99
mailto:birke@kontor4.de
http://www.kontor4.de=
|