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
$path = $this->getBaseDir().$path;
}
/* Remove trailing slashes. */
while (substr($path, -1) === '/') {
$path = substr($path, 0, -1);
}
// remove trailing slashes
$path = rtrim($path, '/');
return $path;
}
......
......@@ -114,10 +114,8 @@ class System
$base = $config->getBaseDir();
}
// remove trailing slashes from $base
while (substr($base, -1) === '/') {
$base = substr($base, 0, -1);
}
// remove trailing slashes
$base = rtrim($base, '/');
// check for absolute path
if (substr($path, 0, 1) === '/') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment