summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-10 19:24:52 +0200
committerAleksander Machniak <alec@alec.pl>2012-10-10 19:24:52 +0200
commit1ff03fb29deb9940cbd14b09a089815d0c1ca2e1 (patch)
tree136bf5ef0fdfae32c2288790fa870197a923a4b7 /program/include
parentc2c162c240da9d3cb6a9b5644aff30cd6822b7fb (diff)
Fix lower-casing email address on replies (#1488598)
Conflicts: CHANGELOG
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_shared.inc23
1 files changed, 23 insertions, 0 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 6767c93e7..c7461edf1 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -582,6 +582,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
*/