aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2019-06-01 00:19:55 +0200
committerfilip <filip.komar@gmail.com>2019-06-01 00:19:55 +0200
commit776b12d8c806e21d7214f203030d3f344df60175 (patch)
tree4213b97b4d1c3cdef726c2a5644cef2f3a89c53c /lib
parentf0f5371a945f20b24900d0a8c17d4cf4c3ba324f (diff)
downloadfidd-776b12d8c806e21d7214f203030d3f344df60175.tar
fidd-776b12d8c806e21d7214f203030d3f344df60175.tar.gz
fidd-776b12d8c806e21d7214f203030d3f344df60175.tar.bz2
fidd-776b12d8c806e21d7214f203030d3f344df60175.tar.xz
fidd-776b12d8c806e21d7214f203030d3f344df60175.zip
small fixes to avoid warnings
Diffstat (limited to 'lib')
-rw-r--r--lib/FIDD.php12
1 files 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'])