Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Elastic skin, Roundcube removes trailing character in non-latin email addresses #9257

Closed
mazerpazer opened this issue Dec 12, 2023 · 2 comments

Comments

@mazerpazer
Copy link

When using Elastic skin, Roundcube UI removes the trailing character in a non-latin (IDN) email address when the user clicks away from the 'To' field in the UI.

This issue affects Roundcube versions 15.x - 1.6.5 and only appears when using Elastic skin.

It seems that the regex that is supposed to remove any non-alpha trailing characters is not configured to support unicode.

Proposed solution - change the regex, so it properly supports unicode encoding:

--- skins/elastic/ui.js.bak	2023-12-11 16:48:40.445899000 +0300
+++ skins/elastic/ui.js	2023-12-12 10:27:25.831659000 +0300
@@ -3413,7 +3413,7 @@
                     recipients.push({
                         name: '',
                         email: email.replace(/(^<|>$)/g, '') // trim < and > characters
-                            .replace(/[^a-z]$/gi, '') // remove trailing comma or any non-letter character at the end (#7899)
+                            .replace(/[^\p{L}]$/giu, '') // remove trailing comma or any non-letter character at the end (#7899)
                     });
 
                     str = str.replace(email, '').trim();
email-2.mp4
@alecpl
Copy link
Member

alecpl commented Dec 12, 2023

Confirmed. The proposed solution will not work in IE11 and Safari 9, which are the supported browsers. so, we might need another fix or we change supported browsers to "Last 2 versions of Edge/Chrome/Firefox/Safari" only.

alecpl added a commit that referenced this issue Dec 15, 2023
alecpl added a commit that referenced this issue Dec 15, 2023
@alecpl
Copy link
Member

alecpl commented Dec 15, 2023

Fixed.

@alecpl alecpl closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants