- Posts: 637
- Thank you received: 26
error with an incorrect email format
6 years 11 months ago #312303
by Lumiga
Kind regards,
Lumiga
error with an incorrect email format was created by Lumiga
-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3
Hi,
When you have a free product (like a workshop) and a customer choose for a guest checkout and don't use a valid email format,
then you wil get an error and no decent notification. After that error the order is also confirmed and the shop owner don't get any e-mail from this order.
Can you please take a look at this issue.
We have tested this in version 4.2.1 and 4.2.2
Kind regards,
Lumiga
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3
Hi,
When you have a free product (like a workshop) and a customer choose for a guest checkout and don't use a valid email format,
then you wil get an error and no decent notification. After that error the order is also confirmed and the shop owner don't get any e-mail from this order.
Can you please take a look at this issue.
We have tested this in version 4.2.1 and 4.2.2
Kind regards,
Lumiga
Kind regards,
Lumiga
Please Log in or Create an account to join the conversation.
6 years 11 months ago #312310
by nicolas
Replied by nicolas on topic error with an incorrect email format
Hi,
Well, that's not really true.
HikaShop does check for the validity of the email address format.
It acutally uses the function JMailHelper::isEmailAddress from the Joomla library.
And not having a dot in the domain name area of an email address is not invalid:
stackoverflow.com/questions/20573488/why...emails-without-a-dot
So Joomla tells HikaShop that the email address format is valid (which it is).
And then, HikaShop uses Joomla's email library to send the email for the order creation which apparently fails on your website because the email address is invalid based on PHPMailer's library used by Joomla's library.
So the problem is that there is an inconsistency between the check done by Joomla and the check done by PHPMailer.
The solution we're going to go with is to change the line:
to:
in the file administrator/components/com_hikashop/classes/user.php
That way both the validaty check from Joomla and the one from PHPMailer will be enforced when the guest form is checking the email address so as to provide a proper error message at that point.
Well, that's not really true.
HikaShop does check for the validity of the email address format.
It acutally uses the function JMailHelper::isEmailAddress from the Joomla library.
And not having a dot in the domain name area of an email address is not invalid:
stackoverflow.com/questions/20573488/why...emails-without-a-dot
So Joomla tells HikaShop that the email address format is valid (which it is).
And then, HikaShop uses Joomla's email library to send the email for the order creation which apparently fails on your website because the email address is invalid based on PHPMailer's library used by Joomla's library.
So the problem is that there is an inconsistency between the check done by Joomla and the check done by PHPMailer.
The solution we're going to go with is to change the line:
Code:
if(empty($registerData->email) || (method_exists('JMailHelper', 'isEmailAddress') && !JMailHelper::isEmailAddress($registerData->email))){
Code:
$mailer = JFactory::getMailer();
if(empty($registerData->email) || (method_exists('JMailHelper', 'isEmailAddress') && !JMailHelper::isEmailAddress($registerData->email)) || !$mailer->validateAddress($registerData->email)){
That way both the validaty check from Joomla and the one from PHPMailer will be enforced when the guest form is checking the email address so as to provide a proper error message at that point.
The following user(s) said Thank You: Lumiga
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds