From 613a4bab2db24001a183d8e248b8042642e0f9fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Nov 2025 10:57:11 +0100 Subject: [PATCH] Fix CI --- htdocs/adherents/agenda.php | 2 +- htdocs/blockedlog/admin/blockedlog_archives.php | 2 +- htdocs/contact/agenda.php | 4 +++- htdocs/core/class/html.formactions.class.php | 2 +- htdocs/core/lib/files.lib.php | 8 ++++---- htdocs/core/lib/functions.lib.php | 5 +++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 6fb7f876911..2cafcc707d0 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array('companies', 'members')); $action = GETPOST('action', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'thirdpartyagenda'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : getDolDefaultContextPage(__FILE__); if (GETPOSTISARRAY('actioncode')) { $actioncode = GETPOST('actioncode', 'array:alpha', 3); diff --git a/htdocs/blockedlog/admin/blockedlog_archives.php b/htdocs/blockedlog/admin/blockedlog_archives.php index 66d6e736b95..7dc47a0fbfc 100644 --- a/htdocs/blockedlog/admin/blockedlog_archives.php +++ b/htdocs/blockedlog/admin/blockedlog_archives.php @@ -505,7 +505,7 @@ if (GETPOST('withtab', 'alpha')) { if ($action == 'deletefile') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles print $form->formconfirm( - $_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOSTINT('linkid').(empty($param) ? '' : $param), + $_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOSTINT('linkid').(empty($param) ? '' : $param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 60430099f8b..5e94ccc157c 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -291,7 +291,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : ''); } $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : '')); - $out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'), 'tzuserrel'); + $out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuserrel')); } if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { @@ -342,6 +342,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); } + $morehtmlright = ''; + print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); // List of all actions diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 8935346d4eb..52a9adcaa44 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -65,7 +65,7 @@ class FormActions * @param integer $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) * @param string $morecss More css on select field * @param int $nooutput 1=No output, return string. 0=Print on output - * @return void + * @return string|void */ public function form_select_status_action($formname, $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100', $nooutput = 0) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 32559cd332e..7c141daa4b4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -47,9 +47,9 @@ function dol_basename($pathfile) * @param string $utf8_path Starting path from which to search. This is a full path. * @param string $types Can be "directories", "files", or "all" * @param int $recursive Determines whether subdirectories are searched - * @param string|string[] $filter Regex or Array of Regex filter to restrict list. The regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, - * but must NOT contains the start and end '/'. Filter is checked into basename only. - * @param string|string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). + * @param string|string[]|null $filter Regex or Array of Regex filter to restrict list. The regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, + * but must NOT contains the start and end '/'. Filter is checked into basename only. + * @param string|string[]|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') * @param int $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only, 4=Force load of perm @@ -70,7 +70,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", // Verify filters (only on the first call of the function) $filter_ok = true; - if (!is_array($filter)) { + if (!empty($filter) && !is_array($filter)) { if (strlen($filter) > 25000) { // Note that limit depends on syntax of filter dol_syslog("Value for filter is too large", LOG_ERR); $filter_ok = false; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cdf81283cc6..1eeace90080 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -126,7 +126,7 @@ if (!function_exists('str_contains')) { * Return the full path of the directory where a module (or an object of a module) stores its files. * Path may depends on the entity if a multicompany module is enabled. * - * @param CommonObject $object Dolibarr common object. + * @param CommonObject|BlockedLog $object Dolibarr common object. * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' * @param int $forobject Return the more complete path for the given object instead of for the module only. * @param string $mode 'output' (full main dir) or 'outputrel' (relative dir) or 'temp' (full dir for temporary files) or 'version' (full dir for archived files) @@ -8487,7 +8487,8 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, // Allow an external module to bypass the calculation of prices $parameters = array('vatvalue' => $vatvalue, 'vatrule' => $vatrule); - $tmpobject = null; $tmpaction = null; + $tmpobject = null; $tmpaction = ''; + // @phan-ignore-next-line PhanPluginConstantVariableNull $reshook = $hookmanager->executeHooks('get_default_tva', $parameters, $tmpobject, $tmpaction); if ($reshook > 0 && !empty($hookmanager->resArray['vatvalue'])) { $vatvalue = $hookmanager->resArray['vatvalue'];