From 49f6a634d0734ead6f6a3260741a68a75964ec95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Aug 2021 15:00:47 +0200 Subject: [PATCH] Fix output of error message. br is no more encoded --- htdocs/public/payment/newpayment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index aeed346ab87..2d47e66aaf8 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -326,6 +326,7 @@ if (!empty($conf->global->$paramcreditorlong)) { $creditor = $conf->global->$paramcreditor; } +$mesg = ''; /* @@ -334,6 +335,7 @@ if (!empty($conf->global->$paramcreditorlong)) { // Action dopayment is called after clicking/choosing the payment mode if ($action == 'dopayment') { + if ($paymentmethod == 'paypal') { $PAYPAL_API_PRICE = price2num(GETPOST("newamount", 'alpha'), 'MT'); $PAYPAL_PAYMENT_TYPE = 'Sale'; @@ -357,7 +359,6 @@ if ($action == 'dopayment') { $shipToState = 'ID-'.$shipToState; } - $mesg = ''; if (empty($PAYPAL_API_PRICE) || !is_numeric($PAYPAL_API_PRICE)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")); $action = ''; @@ -421,7 +422,6 @@ if ($action == 'dopayment') { $urlok = preg_replace('/securekey=[^&]+/', '', $urlok); $urlko = preg_replace('/securekey=[^&]+/', '', $urlko); - $mesg = ''; if (empty($PRICE) || !is_numeric($PRICE)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")); } elseif (empty($email)) { @@ -1984,7 +1984,7 @@ if (!$found && !$mesg) { } if ($mesg) { - print '
'.dol_escape_htmltag($mesg).'
'."\n"; + print '
'.dol_escape_htmltag($mesg, 1, 1, 'br').'
'."\n"; } print ''."\n";