Agreed - there is no $pattern = '/^[A-Z0-9._%\-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i'; in the admin\controller\sale\order.php file. Not even a $pattern.
Are we to ignore this file then and just proceed with the files that do contain this code?
Also, if we've already installed opencart how are we supposed to get the new code into the install/controller/step_3.php file?
Are we to ignore this file then and just proceed with the files that do contain this code?
Also, if we've already installed opencart how are we supposed to get the new code into the install/controller/step_3.php file?
this is for new fresh OC installation only, but you can add the mod to install/controller/step_3.php filedantheman50_98 wrote: Also, if we've already installed opencart how are we supposed to get the new code into the install/controller/step_3.php file?
I noticed this bug before; I changed the code using:Qphoria wrote:I've searched around for the holy grail of email regex.. still not found one.
But I was a step ahead with the one place pattern. The day I made this fix I checked in a change to define the pattern once and use that constant. That will be in effect for 1.5.0
if (!filter_var(filter_var($this->request->post['email'], FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL)) {
$this->error['email'] = $this->language->get('error_email');
}
See also: http://www.charles-reace.com/blog/2008/ ... ate_email/
Or is the change you made to the regex better? (I'm not an professional php-coder). thx.
Actually it seems the FILTER_SANITIZE_EMAIL does use a regex in the background. I've never even thought about this function for email validation. I wonder if it would in fact be a better more standardized approach. I'll research it more. Thanks!Shark wrote:I noticed this bug before; I changed the code using:Qphoria wrote:I've searched around for the holy grail of email regex.. still not found one.
But I was a step ahead with the one place pattern. The day I made this fix I checked in a change to define the pattern once and use that constant. That will be in effect for 1.5.0
if (!filter_var(filter_var($this->request->post['email'], FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL)) {
$this->error['email'] = $this->language->get('error_email');
}
See also: http://www.charles-reace.com/blog/2008/ ... ate_email/
Or is the change you made to the regex better? (I'm not an professional php-coder). thx.
We can increase readability by positioning the dash at first or at last inside the brackets.Qphoria wrote:Confirmed.
1. EDIT the following files:
catalog/controller/account/create.php
catalog/controller/account/edit.php
catalog/controller/checkout/guest_step_1.php
catalog/controller/information/contact.php
catalog/model/checkout/order.php
admin/controller/sale/customer.php
admin/controller/sale/order.php
admin/controller/setting/setting.php
install/controller/step_3.php
2. FIND:3. REPLACE WITH:Code: Select all
$pattern = '/^[A-Z0-9._%-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i';
Code: Select all
$pattern = '/^[A-Z0-9._%\-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i';
So, the string will be
Code: Select all
$pattern = '/^[A-Z0-9._%+-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i';
=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=
MacBook Pro
MAMP 1.9.5
OpenCart 1.4.9.4
I did this fix and it seemed to break the orders coming through via email to the store admin?
Have tried reverting back to the old way for the admin->controller->setting->setting.php file see if that works.
Have tried reverting back to the old way for the admin->controller->setting->setting.php file see if that works.
OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods
Who is online
Users browsing this forum: No registered users and 26 guests