summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-07 20:42:54 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-07 20:43:00 +0200
commit31003b475eebe483c9887c7ca46fd0631ffcf5b0 (patch)
treed10a3074101f794c31ecde9c5438cdba12c55ada
parent7d20e98aec3cbea66134b40747881b0b7b51eb92 (diff)
downloadnextcloud-server-31003b475eebe483c9887c7ca46fd0631ffcf5b0.tar.gz
nextcloud-server-31003b475eebe483c9887c7ca46fd0631ffcf5b0.zip
Decode the alternative path_info
-rw-r--r--lib/request.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/request.php b/lib/request.php
index 9e38e6bbd13..3fe61fbddcd 100644
--- a/lib/request.php
+++ b/lib/request.php
@@ -61,6 +61,17 @@ class OC_Request {
$path_info = $_SERVER['PATH_INFO'];
}else{
$path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
+ // 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'));
+
+ switch($encoding) {
+
+ case 'ISO-8859-1' :
+ $path_info = utf8_encode($path_info);
+
+ }
+ // end copy
}
return $path_info;
}