From 8586816c4708dcbdf28c6761a8949bdf4ad9e5e5 Mon Sep 17 00:00:00 2001 From: Jan Brunemann Date: Wed, 22 Jan 2020 11:33:27 +0100 Subject: [PATCH] #188 only replace basename when there is actually something to replace --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 9a4aaf3..a29342c 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ include_once('includes/config.inc.php'); include_once('includes/session.inc.php'); include_once('includes/misc.inc.php'); -$testpath = str_replace(basename($_SERVER['REQUEST_URI']), $authdb, $_SERVER['REQUEST_URI']); +$testpath = !empty(basename($_SERVER['REQUEST_URI'])) ? str_replace(basename($_SERVER['REQUEST_URI']), $authdb, $_SERVER['REQUEST_URI']) : '/' . $authdb; $testurl = $_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST'].$testpath; global $errormsg, $blocklogin;