From 0b3895e39e62b0a2bf07461c1903eb61ecae266d Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 20 Dec 2019 18:37:51 +0100 Subject: [PATCH] Core update : fix CanUpdateCore result never displayed on server with warning enabled Was caused by a call to : \Combodo\iTop\FilesInformation\Service\FilesInformationUtils::Scan With path set to ''. Made from : \Combodo\iTop\FilesInformation\Service\FilesInformation::CanUpdateCore --- .../src/Service/FilesInformationUtils.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/datamodels/2.x/itop-files-information/src/Service/FilesInformationUtils.php b/datamodels/2.x/itop-files-information/src/Service/FilesInformationUtils.php index 58558c1f0..053ca3539 100644 --- a/datamodels/2.x/itop-files-information/src/Service/FilesInformationUtils.php +++ b/datamodels/2.x/itop-files-information/src/Service/FilesInformationUtils.php @@ -24,10 +24,16 @@ class FilesInformationUtils */ public static function Scan($sPath = '', $bGetDirSize = true) { - $sRealRootPath = utils::AbsolutePath($sPath); - $aFiles = scandir($sRealRootPath); $aFileStats = array(); + $sRealRootPath = utils::AbsolutePath($sPath); + if (empty($sRealRootPath)) + { + return $aFileStats; + } + + $aFiles = scandir($sRealRootPath); + foreach ($aFiles as $sScanFile) { if ($sScanFile == '..')