Fix: Ensure string type for urlencode()

This commit is contained in:
MDW 2024-03-08 02:51:46 +01:00
parent 2d8649dfc3
commit 7155358f12
No known key found for this signature in database

View file

@ -108,7 +108,7 @@ if (!$permissiontoread) {
* Actions
*/
$parameters = array('id'=>$id);
$parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -155,7 +155,7 @@ if ($object->id > 0) {
$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label;
$morehtmlref .= $object->label;
$morehtmlref .= '</div>';
@ -178,14 +178,14 @@ if ($object->id > 0) {
$objthirdparty = $object;
$objcon = new stdClass();
$out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id);
$out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id));
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
$out .= '&backtopage='.urlencode($urlbacktopage);
$permok = $user->hasRight('agenda', 'myactions', 'create');
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') {
$out .= '&socid='.urlencode($objthirdparty->id);
$out .= '&socid='.urlencode((string) ($objthirdparty->id));
}
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
//$out.=$langs->trans("AddAnAction").' ';