diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-08-15 16:21:34 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-08-15 16:23:11 +0200 |
commit | b7c84a1bb82a8446241517577875afd5f9c3a26c (patch) | |
tree | b51e59276e1c8a16c61206cccba647d5aeb9b627 /program/include/rcube_shared.inc | |
parent | de9497cea760849a05f52848b9a670a7006b97d6 (diff) |
Fix lower-casing email address on replies (#1488598)
Diffstat (limited to 'program/include/rcube_shared.inc')
-rw-r--r-- | program/include/rcube_shared.inc | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ -470,6 +470,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 */ |