diff options
| author | fisharebest <fisharebest@gmail.com> | 2010-05-04 21:55:14 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2010-05-04 21:55:14 +0000 |
| commit | 0994d8418a835b06f7ecb77d2a852ee0db86b42a (patch) | |
| tree | ea34a984d0fcf0db1f6593a6c5f508770ab5bce7 | |
| parent | 8a0819066c19a069e39bfb930069610a998c0cb7 (diff) | |
| download | webtrees-0994d8418a835b06f7ecb77d2a852ee0db86b42a.tar.gz webtrees-0994d8418a835b06f7ecb77d2a852ee0db86b42a.tar.bz2 webtrees-0994d8418a835b06f7ecb77d2a852ee0db86b42a.zip | |
Fix: broken HTML in mailto links
| -rw-r--r-- | includes/functions/functions_print.php | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index 1bb5018982..785d765694 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -774,23 +774,14 @@ function user_contact_link($user_id, $method=null) { $method=get_user_setting($user_id, 'contactmethod'); } - // Webmaster/contact addresses can be an email address as well as a user-id - if (strpos($user_id, '@')!==false) { - $email=$user_id; - $fullname=$user_id; - if ($method!='none') { - $method='mailto'; - } - } else { - $email =getUserEmail ($user_id); - $fullname=getUserFullName($user_id); - } + $fullname=getUserFullName($user_id); switch ($method) { case 'none': return ''; case 'mailto': - return "<a href='mailto:{$email}' {$fullname}</a>"; + $email =getUserEmail ($user_id); + return '<a href="mailto:'.htmlspecialchars($email).'">'.htmlspecialchars($fullname).'</a>'; default: return "<a href='javascript:;' onclick='message(\"".get_user_name($user_id)."\", \"{$method}\");return false;'>{$fullname}</a>"; } @@ -803,17 +794,8 @@ function user_contact_menu($user_id, $method=null) { $method=get_user_setting($user_id, 'contactmethod'); } - // Webmaster/contact addresses can be an email address as well as a user-id - if (strpos($user_id, '@')!==false) { - $email=$user_id; - $fullname=$user_id; - if ($method!='none') { - $method='mailto'; - } - } else { - $email =getUserEmail ($user_id); - $fullname=getUserFullName($user_id); - } + $email =getUserEmail ($user_id); + $fullname=getUserFullName($user_id); switch ($method) { case 'none': |
