Fix URL encoding in mediatomb
authorChristian Weiske <cweiske@cweiske.de>
Wed, 25 Nov 2015 22:51:06 +0000 (23:51 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 25 Nov 2015 22:51:06 +0000 (23:51 +0100)
src/mediatomb.php

index 74b7f84..e8bbfcb 100644 (file)
@@ -9,7 +9,7 @@ function handleRequestMediatomb($fullPath, $prefix)
     try {
         $smt = new Services_MediaTomb($user, $pass, $host, $port);
 
-        $path = substr(urldecode($fullPath), strlen($prefix));
+        $path = substr($fullPath, strlen($prefix));
         $container = $smt->getContainerByPath($path);
         $listItems = array();
         addPreviousItem($listItems, $fullPath);
@@ -17,7 +17,7 @@ function handleRequestMediatomb($fullPath, $prefix)
         foreach ($container->getContainers() as $subContainer) {
             $listItems[] = getDirItem(
                 $subContainer->title,
-                $fullPath . rawurlencode($subContainer->title) . '/'
+                pathEncode($fullPath . $subContainer->title) . '/'
             );
         }