From 09918ad6660f897ec8bffba3869ed4614411247a Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Tue, 11 Jan 2022 16:51:11 +0100 Subject: [PATCH] Use empty instead of count to avoid warnings --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 6a5470e..ab9c165 100644 --- a/index.php +++ b/index.php @@ -66,7 +66,7 @@ $files = array_reverse($files); // Get Files for current Page $curfiles = array_slice($files, ($page-1)*$slice ,$slice, true); -if (count($curfiles) > 0 | count($dirs) > 0) { +if (!empty($curfiles)| !empty($dirs)) { // Prepare Generic Data for Template $data['galleryname'] = $galleryname; $data['startpage'] = $_SERVER['PHP_SELF']; @@ -84,7 +84,7 @@ if (count($curfiles) > 0 | count($dirs) > 0) { // Prepare Mode Specific Data and Render Template if ($slice > 1) { - if (count($curfiles) > 0) { + if (!empty($curfiles)) { foreach ($curfiles as $index => $image) { $tmp['n'] = $image; $tmp['i'] = $index+1;