Fix: Ensure string type for urlencode()

This commit is contained in:
MDW 2024-03-08 02:53:33 +01:00
parent 6dbabaa514
commit f12e03cdc1
No known key found for this signature in database

View file

@ -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