From 85423bbf2ca4e7cf970a246a42dfd7d750356c9d Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 16 May 2020 21:39:29 +0200 Subject: [PATCH] =?UTF-8?q?093=20s=C3=A9curise=20la=20mise=20=C3=A0=20jour?= =?UTF-8?q?=20de=20la=20couverture=20de=20la=20galerie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/core.php b/core/core.php index 52afc750..4c82c9bd 100755 --- a/core/core.php +++ b/core/core.php @@ -1264,12 +1264,13 @@ class common { } // Image de couverture if ( $this->getdata(['module',$parent,$galleryKey,'config','homePicture']) === NULL) { - $iterator = new DirectoryIterator($this->getdata(['module',$parent,$galleryKey,'config','directory'])); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { - $this->setdata(['module',$parent,$galleryKey,'config','homePicture',$fileInfos->getFilename()]); - break; - + if (is_dir($this->getdata(['module',$parent,$galleryKey,'config','directory']))) { + $iterator = new DirectoryIterator($this->getdata(['module',$parent,$galleryKey,'config','directory'])); + foreach($iterator as $fileInfos) { + if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { + $this->setdata(['module',$parent,$galleryKey,'config','homePicture',$fileInfos->getFilename()]); + break; + } } } }