From df2f90016f4763351a96821e85ea9a452adfc4b5 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 13 Jun 2013 12:20:27 +0100 Subject: [PATCH] trim leading slashes more efficiently --- core/event.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/event.class.php b/core/event.class.php index 2f3b84dd..81dda8ee 100644 --- a/core/event.class.php +++ b/core/event.class.php @@ -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) {