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']; } }