Skip to content
Snippets Groups Projects
Commit 4d4966dd authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Use the predefined rtrim() function instead of a while loop.

parent f1ac0341
No related branches found
No related tags found
No related merge requests found
...@@ -416,10 +416,8 @@ class SimpleSAML_Configuration ...@@ -416,10 +416,8 @@ class SimpleSAML_Configuration
$path = $this->getBaseDir().$path; $path = $this->getBaseDir().$path;
} }
/* Remove trailing slashes. */ // remove trailing slashes
while (substr($path, -1) === '/') { $path = rtrim($path, '/');
$path = substr($path, 0, -1);
}
return $path; return $path;
} }
......
...@@ -114,10 +114,8 @@ class System ...@@ -114,10 +114,8 @@ class System
$base = $config->getBaseDir(); $base = $config->getBaseDir();
} }
// remove trailing slashes from $base // remove trailing slashes
while (substr($base, -1) === '/') { $base = rtrim($base, '/');
$base = substr($base, 0, -1);
}
// check for absolute path // check for absolute path
if (substr($path, 0, 1) === '/') { if (substr($path, 0, 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