Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting store's email with new gTLD admin/index.php?route=setting/setting #2066

Closed
hamaizing opened this issue Oct 21, 2014 · 5 comments
Closed

Comments

@hamaizing
Copy link

admin/index.php?route=setting/setting
when set a store's email, the valid form does not allow some gTLD extensions - longer than 6 characters - such as .clothing, .photography, ...

Error: E-Mail Address does not appear to be valid!

@ghost
Copy link

ghost commented Oct 21, 2014

Might be a good idea to switch email validation to filter_var($email, FILTER_VALIDATE_EMAIL).

@hamaizing
Copy link
Author

Fixed:
file admin/controller/setting/setting.php line 1274:
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');
}

change {2,6} to {2,15}

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

@hamaizing hamaizing changed the title setting store email admin/index.php?route=setting/setting setting store's email with new gTLD admin/index.php?route=setting/setting Oct 21, 2014
@rokdazone
Copy link
Contributor

Does this email validation take unicode characters into consideration? if not, it might be a good idea...
Chinese characters in emails are valid today.

http://stackoverflow.com/questions/19461943/how-to-validate-a-unicode-email.

EDIT: Maybe just a check for a "@" and a "." character is enough, E-mail validation in backend are kinda useless anyway, maybe just trust the admin to enter a correct e-mail is the best way to go.

@danielkerr
Copy link
Member

filter_var is an extension that needs to be installed in php!

last time i added this i had to do an emergency release because to many people did not have the extension installed.

@ghost
Copy link

ghost commented Oct 23, 2014

@danielkerr It's a built in function.

http://us2.php.net/manual/en/function.filter-var.php

The filter extension is enabled by default as of PHP 5.2.0. Before this time an experimental PECL extension was used, however, the PECL version is no longer recommended or updated.

http://php.net/manual/en/filter.installation.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants