From 01ba5f59f9ce1f0cf0d5377551e538f6f04484a1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 21 Mar 2023 18:22:53 -0400 Subject: [PATCH] Use dirname(__FILE__) instead of DOCUMENT_ROOT. Apparently many people have something wrong in DOCUMENT_ROOT. I don't understand it, but it seems like dirname(__FILE__) is a better solution anyways. --- web/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 24a798438..815fca00e 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2441,7 +2441,7 @@ function getHomeView() { global $skin; if ($user and $user['HomeView']) { $view = detaintPath($user['HomeView']); - $path = $_SERVER['DOCUMENT_ROOT'].'/skins/'.$skin.'/views/'.$view.'.php'; + $path = dirname(__FILE__, 2).'/skins/'.$skin.'/views/'.$view.'.php'; if (file_exists($path)) { return $view; } else { @@ -2450,7 +2450,7 @@ function getHomeView() { } if (defined('ZM_WEB_HOMEVIEW') and ZM_WEB_HOMEVIEW) { $view = detaintPath(ZM_WEB_HOMEVIEW); - $path = $_SERVER['DOCUMENT_ROOT'].'/skins/'.$skin.'/views/'.$view.'.php'; + $path = dirname(__FILE__, 2).'/skins/'.$skin.'/views/'.$view.'.php'; if (file_exists($path)) { return $view; } else {