From 9e99d3ef0a320833250a0343c8b1f9750543f748 Mon Sep 17 00:00:00 2001 From: Chris Park Date: Fri, 21 Oct 2022 14:11:26 -0700 Subject: [PATCH] updates --- diskover-web/public/search.php | 12 +++++++----- diskover-web/src/diskover/Diskover.php | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/diskover-web/public/search.php b/diskover-web/public/search.php index 09d2023f..e528afe8 100644 --- a/diskover-web/public/search.php +++ b/diskover-web/public/search.php @@ -62,11 +62,13 @@ $pp = ltrim($pp, '('); $path = rtrim($pp, '*)'); $rootpath = getRootpath($path); - $_SESSION['rootpath'] = $rootpath; - createCookie('rootpath', $rootpath); - // set path cookie to update tree - createCookie('path', $path); - createCookie('parentpath', getParentDir($path)); + if (!is_null($rootpath)) { + $_SESSION['rootpath'] = $rootpath; + createCookie('rootpath', $rootpath); + // set path cookie to update tree + createCookie('path', $path); + createCookie('parentpath', getParentDir($path)); + } } // curent page diff --git a/diskover-web/src/diskover/Diskover.php b/diskover-web/src/diskover/Diskover.php index 76085c45..0b70993b 100644 --- a/diskover-web/src/diskover/Diskover.php +++ b/diskover-web/src/diskover/Diskover.php @@ -548,6 +548,7 @@ function getRootPath($p) } elseif ($p != '/') { return getRootPath(dirname($p)); } + return null; }