From 7d20e98aec3cbea66134b40747881b0b7b51eb92 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Tue, 7 Aug 2012 20:33:25 +0200 Subject: Move getting the path info to OC_Request --- lib/request.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/request.php') diff --git a/lib/request.php b/lib/request.php index d013844f08d..9e38e6bbd13 100644 --- a/lib/request.php +++ b/lib/request.php @@ -52,6 +52,19 @@ class OC_Request { return($proto); } + /** + * @brief get Path info from request + * @returns string Path info or false when not found + */ + public static function getPathInfo() { + if (array_key_exists('PATH_INFO', $_SERVER)){ + $path_info = $_SERVER['PATH_INFO']; + }else{ + $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME'])); + } + return $path_info; + } + /** * @brief Check if this is a no-cache request * @returns true for no-cache -- cgit v1.2.3