From 0509d0d69df0a86583abce5b972ed9c5c6397a7f Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Tue, 11 Jan 2022 18:12:54 +0100 Subject: [PATCH] Fix even more Warnings --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 73d7901..36e4a3a 100644 --- a/index.php +++ b/index.php @@ -70,8 +70,10 @@ if (isset($_GET['f'])) { if ($_GET['f'] != '') { $tr = array('(' => '\(', ')' => '\)'); $f = strtr($_GET['f'], $tr); - $files = array_values(preg_grep('/.*'.$f.'.*/i', $files)); - $dirs = array_values(preg_grep('/.*'.$f.'.*/i', $dirs)); + if (!empty($files)) + $files = array_values(preg_grep('/.*'.$f.'.*/i', $files)); + if (!empty($dirs)) + $dirs = array_values(preg_grep('/.*'.$f.'.*/i', $dirs)); $filter='&f='.$_GET['f']; } }