Skip to content
Snippets Groups Projects
Commit a3e35a6c authored by Olav Morken's avatar Olav Morken
Browse files

SimpleSAML_Configuration::resolvePath(): Support absolute path on windows.

Thanks to c960657 <http://code.google.com/u/c960657/> for providing
this patch.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2299 44740490-163a-0410-bde0-09ae8108e29a
parent ecefce29
No related branches found
No related tags found
No related merge requests found
...@@ -361,10 +361,12 @@ class SimpleSAML_Configuration { ...@@ -361,10 +361,12 @@ class SimpleSAML_Configuration {
assert('is_string($path)'); assert('is_string($path)');
/* Prepend path with basedir if it doesn't start with /* Prepend path with basedir if it doesn't start with a slash or a Windows
* a slash. We assume getBaseDir ends with a slash. * drive letter (e.g. "C:\"). We assume getBaseDir ends with a slash.
*/ */
if ($path[0] !== '/') $path = $this->getBaseDir() . $path; if ($path[0] !== '/' &&
!(preg_match('@^[a-z]:[\\\\/]@i', $path, $matches) && is_dir($matches[0])))
$path = $this->getBaseDir() . $path;
/* Remove trailing slashes. */ /* Remove trailing slashes. */
while (substr($path, -1) === '/') { while (substr($path, -1) === '/') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment