From 0e1dcb9408eb623e34f5c209396e558c827823c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Wed, 5 Sep 2012 13:05:24 +0200 Subject: [PATCH] Use a more standard behaviour: If hook return non zero, it is a "replace code" hook. Otherwise, it is "insert code" hook. --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d477d4b40c7..074d18adfff 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -83,9 +83,9 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil 'loaddate' => $loaddate, 'loadsize' => $loadsize ); - $ret=$hookmanager->executeHooks('getDirList', $parameters); + $reshook=$hookmanager->executeHooks('getDirList', $parameters); - if (! empty($hookmanager->resArray)) + if (! empty($reshook)) // If hook return non zero, it is a "replace code" hook. Otherwise, it is "insert code" hook. { return $hookmanager->resArray; } -- GitLab