[-] MO sendtoafriend: The method used to check all required input fields could lead to errors

This commit is contained in:
Fabio Chelly committed 2013-09-27 16:08:00 +02:00
1 parent 6449ecfb32
commit 9d94337c9b
2 files changed
+9 -25

No files matched your search

+3 -13
View File
@@ -33,19 +33,9 @@ $module = new SendToAFriend();
if (Tools::getValue('action') == 'sendToMyFriend' && Tools::getValue('secure_key') == $module->secure_key)
{
$friend_infos = Tools::jsonDecode(Tools::getValue('friend'));
$friendName = "";
$friendMail = "";
$id_product = null;
foreach ($friend_infos as $entry)
{
if ($entry->key == "friend_name")
$friendName = $entry->value;
else if ($entry->key == "friend_email")
$friendMail = $entry->value;
else if ($entry->key == "id_product")
$id_product = $entry->value;
}
$friendName = Tools::getValue('name');
$friendMail = Tools::getValue('email');
$id_product = Tools::getValue('id_product');
if (!$friendName || !$friendMail || !$id_product)
die('0');