Post by Argen » Wed May 21, 2014 12:02 am

Hi All,

We have the need to not use email addresses for the users of the store.

So, I have changed all the requirements on the backend for this. But I ran into this problem, and I cannot find where the heck its coming from!

Image

Where is this validation set? I want to turn it off. >:D

Thanks!
Last edited by Argen on Thu May 22, 2014 12:03 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Feb 07, 2014 12:21 am

Post by NoJoke » Wed May 21, 2014 11:00 am

I think it has something to do with this code that is in the catalog/model/account/customer.php

Code: Select all

			foreach ($emails as $email) {
				if (strlen($email) > 0 && preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $email)) {
					$mail->setTo($email);
					$mail->send();
				}

I might be wrong but that is the only thing that I can find just quickly looking at it...if you remove the /^[^\@]+@.*\. and check it to see if it works.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by Argen » Thu May 22, 2014 12:02 am

@NoJoke, thanks a lot! That was it! O0

Newbie

Posts

Joined
Fri Feb 07, 2014 12:21 am

Post by NoJoke » Thu May 22, 2014 6:58 am

No problem, glad I was able to help you getting that solved.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by mobiphone » Sat Jul 05, 2014 5:57 pm

i use a new tld .bargains and my admin email in the account settings is rejected as "non valid" (obviously is very valid). could you advise?

thank you

Newbie

Posts

Joined
Sat Jul 05, 2014 5:55 pm

Post by NoJoke » Tue Aug 05, 2014 11:52 am

go to /admin/controller/setting

go to the setting.php file and search for

Code: Select all

if ((utf8_strlen($this->request->post['config_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['config_email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	}
and change it to :

Code: Select all

if ((utf8_strlen($this->request->post['config_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,9}$/i', $this->request->post['config_email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	}
The part of the code that is not allowing you to put in the .bargains is where it says {2,6}. Basically it is looking for a .tld that has a-z that is between 2 and 6 characters long and since bargains is 8 characters it is over the 6 character limit, thus throwing the error.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am
Who is online

Users browsing this forum: No registered users and 21 guests