From 4111ae6270c9638f68bb84f4bc5ff461275909d2 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sun, 5 Apr 2020 18:59:17 +0200 Subject: [PATCH] =?UTF-8?q?Gallery=20,=20mettre=20=C3=A0=20jour=20la=20cou?= =?UTF-8?q?verture=20import=20v9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index 09ba21a8..3bc448ef 100644 --- a/core/core.php +++ b/core/core.php @@ -1140,8 +1140,14 @@ class common { } // Image de couverture if ( $this->getdata(['module',$parent,$galleryKey,'config','homePicture']) === NULL) { - $this->setdata(['module',$parent,$galleryKey,'config','homePicture','']); - } + $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; + } + } + } } } }