From bf65dee557f235d87960ca1fdd657d04cd7b593e Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 23 Oct 2012 10:38:14 +0000 Subject: [PATCH] since we allow ampersand in local-part of the emailaddress, we have to handle this while preprocessing template data --- etemplate/inc/class.url_widget.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.url_widget.inc.php b/etemplate/inc/class.url_widget.inc.php index 9bd52cbc2b..4cb00862b1 100644 --- a/etemplate/inc/class.url_widget.inc.php +++ b/etemplate/inc/class.url_widget.inc.php @@ -118,11 +118,14 @@ class url_widget $value = $matches[1]; $email = $matches[2]; } - elseif (strpos($email=$value,'@') !== false) + elseif (($at_pos = strpos($email=$value,'@')) !== false) { - if (strpos($email=$value,'&') !== false) + if (($amp_pos = strpos(substr($value,$at_pos),'&')) !== false) { - list($email,$addoptions) = explode('&',$value,2); + //list($email,$addoptions) = explode('&',$value,2); + $email = substr($value,0,$amp_pos+$at_pos); + $addoptions = substr($value, $amp_pos+$at_pos+1); + //error_log(__METHOD__.__LINE__.$email.' '.$addoptions); $rfc822 = $value = $email; } if (strlen($value) > $size) // shorten the name to size-2 plus '...'