0

I'm looking for a way to block registrations with an email-address that includes a plus character, e.g. name+foo@domain.com

The build-in 'email domain options' don't seem to work here.

  • 2
    Apparently + is a valid character for an email address. https://stackoverflow.com/questions/2049502/what-characters-are-allowed-in-an-email-address – Juan Nov 27 '18 at 13:42
  • It is! I want to keep people from easily creating multiple accounts. – serve.chilled Nov 27 '18 at 13:52
  • It would be much better to put your comment about your actual goal in the question. – Elin Nov 30 '18 at 08:41
  • I'd suggest going to the joomla stackexchange site [joomla.se] for help, but if you just want something simple, replace the login module with your own module with different javascript validation regex. You could also change the validation serverside by reviewing how to create your own option. Doing the javascript alone won't stop a determined person, but might be sufficient for your purposes. – Elin Nov 30 '18 at 08:46

2 Answers2

0

Have you tried slicing before the @ and then maybe verify if that part has a special character? I hope that helps a bit.

ytrao
  • 47
  • 6
  • slicing? Could you elaborate on that? I tried to disallow `*+*` but it did not work. Not sure how regular expressions work here. – serve.chilled Nov 27 '18 at 13:54
  • Basically I was thinking of using some string manipulation to verify if the email has your special character...like slice or substring.... – ytrao Nov 27 '18 at 14:10
-1

There are some great suggestions on this topic in the joomla forums:

[For a] quick and dirty validation on the server side, modify line 131 of libraries/src/Mail/MailHelper.php:

// 20181127 prevent plus character 
// $allowed = "a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-";
$allowed = "a-zA-Z0-9.!#$%&'*\/=?^_`{|}~-";     
// 20181127 end

Source: https://forum.joomla.org/viewtopic.php?f=706&t=967556&p=3549487#p3549487

  • It is bad advice to directly modify corefiles, first they will get changed on updating and second you may regret it for other reasons. Instead always override. – Elin Nov 30 '18 at 08:42