From: Marcin Haba Date: Thu, 23 May 2019 05:06:25 +0000 (+0200) Subject: baculum: Fix #2474 error 404 if document root path uses link with ending slash -... X-Git-Tag: Release-9.4.4~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72940148d094d638c11eb5efaddd86b9fe450039;p=thirdparty%2Fbacula.git baculum: Fix #2474 error 404 if document root path uses link with ending slash - fix suggested by vondi --- diff --git a/gui/baculum/protected/Common/Class/BaculumPage.php b/gui/baculum/protected/Common/Class/BaculumPage.php index 1327f7f39..783e6c92c 100644 --- a/gui/baculum/protected/Common/Class/BaculumPage.php +++ b/gui/baculum/protected/Common/Class/BaculumPage.php @@ -114,7 +114,9 @@ class BaculumPage extends TPage { for($i = 0; $i < count($dirs); $i++) { $document_root_part = implode('/', $root_dir) . '/' . $dirs[$i]; if (is_link($document_root_part)) { - $root_dir = array(readlink($document_root_part)); + $temp = readlink($document_root_part); + $temp = rtrim($temp, '/'); + $root_dir = array($temp); } else { $root_dir[] = $dirs[$i]; }