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:21:34 +0200 |
commit | 6ab9369eb194e4dde0cc830a84466dd240e95b23 (patch) | |
tree | f6ca70f59b7a470dc0af2553b701b12aee333489 /program/include | |
parent | 38ea9af1e685aeb89b5823e59ccd2c8fb481162c (diff) |
Fix lower-casing email address on replies (#1488598)
Diffstat (limited to 'program/include')
-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 85f278432..5b839d8d2 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -306,6 +306,29 @@ function format_email_recipient($email, $name = '') /** + * 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 */ if (!extension_loaded('mbstring')) |