From 070a315718c1974eb3853c17b76bee2d8e9eada9 Mon Sep 17 00:00:00 2001 From: Luke Carrier <luke@carrier.im> Date: Tue, 21 Feb 2017 13:15:46 +0000 Subject: [PATCH] Resolve Configuration paths via System::resolvePath() --- lib/SimpleSAML/Configuration.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 4370473b6..4ad602313 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -1,5 +1,6 @@ <?php +use SimpleSAML\Utils\System; /** * Configuration of SimpleSAMLphp @@ -542,19 +543,7 @@ class SimpleSAML_Configuration assert('is_string($path)'); - /* Prepend path with basedir if it doesn't start with a slash or a Windows drive letter (e.g. "C:\"). We assume - * getBaseDir ends with a slash. - */ - if ($path[0] !== '/' && - !(preg_match('@^[a-z]:[\\\\/]@i', $path, $matches) && is_dir($matches[0])) - ) { - $path = $this->getBaseDir().$path; - } - - // remove trailing slashes - $path = rtrim($path, '/'); - - return $path; + return System::resolvePath($path, $this->getBaseDir()); } -- GitLab