From f12e03cdc13da52a9ec1a918a4cdb348d91ba4c6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:33 +0100 Subject: [PATCH] Fix: Ensure string type for urlencode() --- htdocs/public/eventorganization/attendee_new.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index edccbf8006a..7de72eac061 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -235,7 +235,7 @@ if ($reshook < 0) { } // Action called when page is submitted -if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status==2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { +if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status == 2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { $error = 0; $urlback = ''; @@ -600,7 +600,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // Now we redirect to the payment page $sourcetouse = 'organizedeventregistration'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode($sourcetouse).'&ref='.urlencode($reftouse); + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode((string) ($sourcetouse)).'&ref='.urlencode((string) ($reftouse)); if (getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { $redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical