[-] FO : Invalid voucher name
This commit is contained in:
@@ -184,7 +184,7 @@ class CartRuleCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByCode($code)
|
||||
{
|
||||
if (!Validate::isDiscountName($code))
|
||||
if (!Validate::isCleanHtml($code))
|
||||
return false;
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_cart_rule` FROM `'._DB_PREFIX_.'cart_rule` WHERE `code` = \''.pSQL($code).'\'');
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
{
|
||||
if (!($code = trim(Tools::getValue('discount_name'))))
|
||||
$this->errors[] = Tools::displayError('You must enter a voucher code');
|
||||
elseif (!Validate::isDiscountName($code))
|
||||
elseif (!Validate::isCleanHtml($code))
|
||||
$this->errors[] = Tools::displayError('Voucher code invalid');
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user