From 1f056c4102e951763bae3017d061fcdfd4423d52 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 26 May 2025 21:26:44 +0200 Subject: [PATCH] Better rule for redirect to paymentok/ko. --- htdocs/public/payment/newpayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1290ed346cf..7d051c26134 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -258,7 +258,8 @@ if ($ws && !defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { // $tmpwebsite = new Website($db); $tmpwebsite->fetch(0, $ws); - if ($tmpwebsite->virtualhost == $lastproxy) { + if (preg_replace('/https?:\/\//i', '', $tmpwebsite->virtualhost) == $lastproxy) { + // If the newpayment.php page was called from a proxy with same domain than the website virtual host, we must use this one as the redirect domain url. $urlok = $tmpwebsite->virtualhost.'/public/payment/paymentok.php?'; $urlko = $tmpwebsite->virtualhost.'/public/payment/paymentko.php?'; }