From 3fd7c26cf1602fa4aa0d61119c9f3ae0641f3f79 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis.houssin@capnetworks.com>
Date: Thu, 11 Jun 2015 07:15:40 +0200
Subject: [PATCH] Fix: disable hook calling

---
 htdocs/compta/facture/mergepdftool.php | 4 ++--
 htdocs/core/lib/files.lib.php          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php
index ff1bde24466..146ee53736c 100644
--- a/htdocs/compta/facture/mergepdftool.php
+++ b/htdocs/compta/facture/mergepdftool.php
@@ -275,7 +275,7 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
 	{
 	    $arrayofinclusion=array();
 	    foreach($_POST['toGenerate'] as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/');
-		$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC);
+		$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true);
 
 		// liste les fichiers
 		$files = array();
@@ -284,7 +284,7 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
 		{
 			foreach($factures as $facture)
 			{
-				if(strstr($facture["name"],$basename))
+				if (strstr($facture["name"],$basename))
 				{
 					$files[] = $conf->facture->dir_output.'/'.$basename.'/'.$facture["name"];
 				}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 05fdcc96624..a8eeb8d3214 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -152,7 +152,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
 						// if we're in a directory and we want recursive behavior, call this function again
 						if ($recursive)
 						{
-							$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode));
+							$file_list = array_merge($file_list,dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook));
 						}
 					}
 					else if (! $isdir && (($types == "files") || ($types == "all")))
-- 
GitLab