Patch 5.6 to accept new top level domain extensions

Permalink
What file do we edit to have the most recent version v5.6 to allow domain extensions? We have a client with a .services domain and 5.6 will not let us put this anywhere, says invalid for email.

Very frustrating. What file do we edit to fix this?

Thanks.

 
tallacman replied on at Permalink Reply 1 Attachment
tallacman
Huh?
Im running <meta name="generator" content="concrete5 - 5.6.3.2" />
and Ive got it set up not problemo. See attached.
ctadmin replied on at Permalink Reply
Try it with .services

I think it's a length issue.
tallacman replied on at Permalink Reply
tallacman
Ahhh! yes looks like limit on the the field. Must be a hack somewhere for that.
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
On line 22 of concrete/core/helpers/validation/strings.php you will see
if (preg_match('/^([a-zA-Z0-9\._\+-]+)\@((\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,7}|[0-9]{1,3})(\]?))$/', $em, $matches)) {

change it to
if (preg_match('/^([a-zA-Z0-9\._\+-]+)\@((\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,8}|[0-9]{1,3})(\]?))$/', $em, $matches)) {

This will allow TLD extensions that are 8 characters in length instead of only 7 characters.
Probably best to over-ride this file rather than hack the Core file..
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
As a follow up..
To override this core file, create a folder called 'validation' in the root/helpers folder.
Copy the strings.php file from the concrete/core/helpers/validation folder into the root/helpers/validation folder.
Change line 13 from this
class Concrete5_Helper_Validation_Strings {

To this
class ValidationStringsHelper extends Concrete5_Helper_Validation_Strings {

And also change the code in line 22 as in my first post..
ctadmin replied on at Permalink Reply
Thank you!!!

But there are domain extensions that are longer than 8 characters, so I'll probably change it to higher. We've gone one client using a .consulting

thanks again.
ctadmin replied on at Permalink Reply
Just for reference, from our registrar, 14 characters is the longest domain extension so far.
ctadmin replied on at Permalink Reply
I can report this worked, although I had to clear cache first.

Thanks again!

I'd make the suggestion that if another 5.6 patch comes out that this gets included because the alt tlds are getting more wide spread.
tallacman replied on at Permalink Reply
tallacman
Maybe this should go into the next update.