trim leading slashes more efficiently

This commit is contained in:
Shish 2013-06-13 12:20:27 +01:00
parent 19c0868b2c
commit df2f90016f

View file

@ -34,9 +34,7 @@ class PageRequestEvent extends Event {
global $config;
// trim starting slashes
while(strlen($path) > 0 && $path[0] == '/') {
$path = substr($path, 1);
}
$path = ltrim($path, "/");
// if path is not specified, use the default front page
if(strlen($path) === 0) {