Advertisement:

Author Topic: SMF doeasn't recognize new domain names and considers these as invalid  (Read 5304 times)

Offline koubel

  • Newbie
  • *
  • Posts: 4
When anonymous user (who is not logged in) wants to add new topic with email "tester@czech.systems" SMF doesn't allow it and shows warning about invalid email. It's wrong because "tester@czech.systems" is valid email address.

Tested on latest SMF 2.0.11 linux mysql

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,265
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF doeasn't recognize new domain names and considers these as invalid
« Reply #1 on: October 29, 2015, 12:16:34 PM »
probably....

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."

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,759
  • Gender: Male
Re: SMF doeasn't recognize new domain names and considers these as invalid
« Reply #2 on: October 29, 2015, 12:54:25 PM »
The fix is quite easy, though...

In Subs-Members.php, you find this:
Code: [Select]
// !!! 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
Code: [Select]
{2,6}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

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

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,502
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF doeasn't recognize new domain names and considers these as invalid
« Reply #3 on: October 29, 2015, 01:01:16 PM »
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!

SMFHacks.com -  Paid Modifications for SMF

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

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,937
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: SMF doeasn't recognize new domain names and considers these as invalid
« Reply #4 on: October 30, 2015, 12:51:27 PM »
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
Cincy Space - now open!

Offline koubel

  • Newbie
  • *
  • Posts: 4
Re: SMF doeasn't recognize new domain names and considers these as invalid
« Reply #5 on: February 24, 2016, 08:55:10 AM »
So thank you guys (better late than never).