No Code Attached Yet bug
avatar JamesNGarrett
JamesNGarrett
17 Nov 2023

Steps to reproduce the issue

Try to create a user with an apostrophe (single straight quote ' ), in the username part of the email like DeloresO'Grady@example.com

Expected result

Email is accepted.

Actual result

Email is declared invalid.

Additional comments

This was previously (in 2016) discussed here: #6982

And fixed here: #12835

But the email validation regex in media/system/fields/js/validate is currently set to not allow '

    this.setHandler('email', value => {
        const newValue = punycode.toASCII(value);
        const regex = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
        return regex.test(newValue);
    });
avatar JamesNGarrett JamesNGarrett - open - 17 Nov 2023
avatar joomla-cms-bot joomla-cms-bot - change - 17 Nov 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Nov 2023
avatar drmenzelit
drmenzelit - comment - 18 Nov 2023

Which Joomla version are you using?

avatar drmenzelit drmenzelit - change - 18 Nov 2023
Labels Added: Information Required
avatar drmenzelit drmenzelit - labeled - 18 Nov 2023
avatar drmenzelit
drmenzelit - comment - 18 Nov 2023

Problem confirmed in Joomla 5.0

avatar drmenzelit drmenzelit - change - 18 Nov 2023
Labels Added: bug
avatar drmenzelit drmenzelit - labeled - 18 Nov 2023
avatar brianteeman
brianteeman - comment - 18 Nov 2023

very strange that its passing the specific unit test for this tests\Unit\Libraries\Cms\Mail\MailHelperTest.php

avatar JamesNGarrett
JamesNGarrett - comment - 19 Nov 2023

To be clear this is a js validation error and not a server side error. Hence the unit test passes.

An email with a smart (not straight) apostrophe (eg o’reilly@there.com) passes js validation and fails on save.

avatar Quy Quy - change - 18 Dec 2023
Labels Removed: Information Required
avatar Quy Quy - unlabeled - 18 Dec 2023

Add a Comment

Login with GitHub to post a comment