SMF doeasn't recognize new domain names and considers these as invalid

Started by koubel, October 29, 2015, 11:20:16 AM

Previous topic - Next topic


When anonymous user (who is not logged in) wants to add new topic with email "[email protected]" SMF doesn't allow it and shows warning about invalid email. It's wrong because "[email protected]" is valid email address.

Tested on latest SMF 2.0.11 linux mysql



the new (and bizarre) TLDs are not supported as valid domains in email addresses...

remember... v2.0 is a few years old at this point and the new TLDs did not exist when it was created.

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


The fix is quite easy, though...

In Subs-Members.php, you find this:
// !!! Separate the sprintf?
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $regOptions['email']) === 0 || strlen($regOptions['email']) > 255)
$reg_errors[] = array('lang', 'profile_error_bad_email');

This bit here
States that the .something must be between 2 and 6 characters (after the dot) long. ."systems" is *7* characters long :P
So you can change the upper limit to a more pleasant value to you ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair


Yeah I would recommend changing the {2,6} to something higher maybe 10
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more! -  Paid Modifications for SMF

EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


Looking at the list on Wikipedia, the longest non-international TLD at the moment is ".cancerresearch", which is 15 characters. Most seem to be 12 or fewer characters though.
Michael Eshom
Christian Metal Fans