Previous Thread
Next Thread
Print Thread
Hop To
Joined: May 2019
Posts: 2
G
Stranger
Stranger
G Offline
Joined: May 2019
Posts: 2
Hi all,

After searching here, I haven't found much about this.

As of 7.7.2, I couldn't register on this forum using my email address (ending in ".paris", one of the numerous TLDs now in the wild) as it's considered "invalid".
Is it a deliberate choice ? or just a slip of a too restrictive regex ?

Thanks for your help

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Beyond adding an HTML5 email type to the input, the current regex hasnt been updated since at least the past 5 years (that I'm aware of) is:
Code
#^[+_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$#i
It looks like it's only accepting a TLD of 2 - 4 chars. "paris" is 5, so it is determined to be invalid.


Using regex for modern email validation is quite messy. Moving forward, PHP will be used to handle submitted HTML from the end user.
Code
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
	return array(false, 'BAD_FORMAT');
}
https://www.php.net/manual/en/function.filter-var.php

...and HTML5 input type=email will catch the user entry from the input field.
In Opera it's sufficient to enter just *@* for the input to be accepted. In Safari, Chrome and Firefox you need to enter at least *@-.-. Obviously neither example is very limiting, but it will prevent people from entering completely wrong values, such as phone number, strings with multiple '@'s or spaces.


Thanks for catching and reporting this. it should be corrected with the UBB.thread 7.7.2 release!


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: May 2019
Posts: 2
G
Stranger
Stranger
G Offline
Joined: May 2019
Posts: 2
Yay, thanks for your help :-)


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
0 members (), 919 guests, and 149 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)