summaryrefslogtreecommitdiffstats
path: root/lib/request.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/request.php')
-rwxr-xr-xlib/request.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/request.php b/lib/request.php
index 30a25df23ab..9f74cf9beb5 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -107,7 +107,7 @@ class OC_Request {
if (array_key_exists('PATH_INFO', $_SERVER)) {
$path_info = $_SERVER['PATH_INFO'];
}else{
- $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
+ $path_info = self::getRawPathInfo();
// following is taken from Sabre_DAV_URLUtil::decodePathSegment
$path_info = rawurldecode($path_info);
$encoding = mb_detect_encoding($path_info, array('UTF-8', 'ISO-8859-1'));
@@ -124,6 +124,19 @@ class OC_Request {
}
/**
+ * @brief get Path info from request, not urldecoded
+ * @returns string Path info or false when not found
+ */
+ public static function getRawPathInfo() {
+ $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
+ // Remove the query string from REQUEST_URI
+ if ($pos = strpos($path_info, '?')) {
+ $path_info = substr($path_info, 0, $pos);
+ }
+ return $path_info;
+ }
+
+ /**
* @brief Check if this is a no-cache request
* @returns true for no-cache
*/