From 48ea593afd83b10727ca6fcc3a48ee779dc05db8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Mar 2026 16:36:23 +0200 Subject: [PATCH] Clean code --- htdocs/accountancy/bookkeeping/export.php | 2 +- htdocs/ai/admin/log_viewer.php | 4 ++-- htdocs/compta/paiement/document.php | 5 ++--- htdocs/expedition/list.php | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 65b605e3a3e..56f788746bc 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -902,7 +902,7 @@ if ($contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); + $param .= '&limit='.((int) $limit); } // List of mass actions available diff --git a/htdocs/ai/admin/log_viewer.php b/htdocs/ai/admin/log_viewer.php index 6e230407307..a3ae83d6513 100644 --- a/htdocs/ai/admin/log_viewer.php +++ b/htdocs/ai/admin/log_viewer.php @@ -170,11 +170,11 @@ if ($contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); + $param .= '&limit='.((int) $limit); } foreach ($search_array as $key => $val) { if (!empty($val) || $val === '0') { - $param .= '&' . $key . '=' . urlencode($val); + $param .= '&' . urlencode($key) . '=' . urlencode($val); } } diff --git a/htdocs/compta/paiement/document.php b/htdocs/compta/paiement/document.php index fdbb3ac4671..f3fb3b23bb3 100644 --- a/htdocs/compta/paiement/document.php +++ b/htdocs/compta/paiement/document.php @@ -88,9 +88,8 @@ if ($object->fetch($id, $ref)) { if ($user->socid) { $socid = $user->socid; } -if ($object !== null) { - $result = restrictedArea($user, $object->element, $object->id, 'payment', ''); -} + +restrictedArea($user, $object->element, $object->id, 'payment', ''); $permissiontoadd = ($user->hasRight('facture', 'creer')); // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index fe682ba7c75..7c477bdae04 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -533,7 +533,7 @@ if (empty($reshook)) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode(strval($limit)); + $param .= '&limit='.((int) $limit); } if ($search_all) { $param .= "&search_all=".urlencode($search_all);