From 750ecd4804085b18bc7e416bf2a292f3bfde57c2 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Fri, 28 Jul 2023 10:01:43 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B06061=20-=20allow=20local=20path=20from?= =?UTF-8?q?=20an=20arbitrary=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/utils.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/utils.inc.php b/application/utils.inc.php index d8b2c47f7..ebcaefe1e 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2647,15 +2647,16 @@ SQL; } /** - * Returns the local path relative to the iTop installation of an existing file + * Returns the local path relative to the iTop installation (APPROOT or the given base path) * Dir separator is changed to '/' for consistency among the different OS * * @param string $sAbsolutePath absolute path - * @param string $sBasePath + * @param string $sBasePath Base path for the resulting local path (default APPROOT) * - * @return false|string + * @return false|string The generated local path or false if absolute path is not under the base path + * @since 3.1.1 Added base path defaulted to previous version APPROOT */ - final public static function LocalPath(string $sAbsolutePath, string $sBasePath = APPROOT) + final public static function LocalPath($sAbsolutePath, string $sBasePath = APPROOT) { $sRootPath = realpath($sBasePath); $sFullPath = realpath($sAbsolutePath);