From b7c84a1bb82a8446241517577875afd5f9c3a26c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 15 Aug 2012 16:21:34 +0200 Subject: Fix lower-casing email address on replies (#1488598) --- program/include/rcube_shared.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'program/include') diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 8f5f0739a..3d3255555 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -469,6 +469,29 @@ function array_keys_recursive($array) } +/** + * Format e-mail address + * + * @param string $email E-mail address + * + * @return string Formatted e-mail address + */ +function format_email($email) +{ + $email = trim($email); + $parts = explode('@', $email); + $count = count($parts); + + if ($count > 1) { + $parts[$count-1] = mb_strtolower($parts[$count-1]); + + $email = implode('@', $parts); + } + + return $email; +} + + /** * mbstring replacement functions */ -- cgit v1.2.3