From 776b12d8c806e21d7214f203030d3f344df60175 Mon Sep 17 00:00:00 2001 From: filip Date: Sat, 1 Jun 2019 00:19:55 +0200 Subject: small fixes to avoid warnings --- lib/FIDD.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/FIDD.php b/lib/FIDD.php index d15ab35..b61132d 100644 --- a/lib/FIDD.php +++ b/lib/FIDD.php @@ -109,9 +109,11 @@ class FIDD if ($ret === 0) { foreach ($out as $line) { $line = explode("\t", trim($line)); - if (trim(substr($line[1], -3, 3)) == 'iso') { - $file = explode('/', $line[1]); - $isos[$file[1]] = formatBytes($line[0], 1); + if (count($line) > 1) { + if (trim(substr($line[1], -3, 3)) == 'iso') { + $file = explode('/', $line[1]); + $isos[$file[1]] = formatBytes($line[0], 1); + } } } } @@ -169,7 +171,9 @@ class FIDD } - if (null !== ($ret = self::is_correct_name($data['file']))) { + if ( count($data) == 0) { + // skip the first one + } else if (null !== ($ret = self::is_correct_name($data['file']))) { $data['path'] = sprintf('%s/%s', $ret['release'] == '' ? sprintf('iso/%s', $ret['version']) : 'iso/cauldron', str_replace('.iso', '', $data['file']) -- cgit v1.2.1