From 568740cdc435595883ae7f0c8c01d86914c6d687 Mon Sep 17 00:00:00 2001 From: e107steved Date: Thu, 30 Oct 2008 22:42:41 +0000 Subject: [PATCH] Move email obfuscation function somewhere sensible --- e107_handlers/e_parse_class.php | 21 +++++++++++++++++++-- e107_themes/templates/signup_template.php | 13 +++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 7b87eccbc..675b32c99 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $ -| $Revision: 1.38 $ -| $Date: 2008-09-04 19:50:10 $ +| $Revision: 1.39 $ +| $Date: 2008-10-30 22:42:36 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -1086,6 +1086,23 @@ class e_parse return $text; } + + // Given an email address, returns a link including js-based obfuscation + function emailObfuscate($email, $words='', $subject='') + { + if (strpos($email,'@') === FALSE) + { + return ''; + } + if ($subject) + { + $subject = '?subject='.$subject; + } + list($name,$address) = explode('@',$email,2); + $reassembled = '"'.$name.'"+"@"+"'.$address.'"'; + return "".$words.''; + } + } ?> \ No newline at end of file diff --git a/e107_themes/templates/signup_template.php b/e107_themes/templates/signup_template.php index 4294b70e6..eaecbf2d5 100755 --- a/e107_themes/templates/signup_template.php +++ b/e107_themes/templates/signup_template.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_themes/templates/signup_template.php,v $ -| $Revision: 1.9 $ -| $Date: 2008-07-30 20:13:49 $ +| $Revision: 1.10 $ +| $Date: 2008-10-30 22:42:41 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -23,13 +23,6 @@ if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:100%"); } define("REQUIRED_FIELD_MARKER", " *"); -// Given an email address, returns a link including js-based obfuscation -function js_obfuscate($email) -{ - list($name,$address) = explode('@',$email,2); - $reassembled = '"'.$name.'"+"@"+"'.$address.'"'; - return ""; -} $sc_style['SIGNUP_DISPLAYNAME']['pre'] = " @@ -157,7 +150,7 @@ $sc_style['SIGNUP_IMAGECODE']['post'] = " if(!defined($COPPA_TEMPLATE)) { -$COPPA_TEMPLATE = LAN_109." ".LAN_SIGNUP_14.". ".LAN_SIGNUP_15." ".js_obfuscate(SITEADMINEMAIL).LAN_SIGNUP_14." ".LAN_SIGNUP_16." +$COPPA_TEMPLATE = LAN_109." ".LAN_SIGNUP_14.". ".LAN_SIGNUP_15." ".$tp->emailObfuscate(SITEADMINEMAIL,LAN_SIGNUP_14)." ".LAN_SIGNUP_16."

".LAN_SIGNUP_17."