url-encode paths
authorChristian Weiske <cweiske@cweiske.de>
Wed, 25 Nov 2015 00:26:03 +0000 (01:26 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 25 Nov 2015 00:26:03 +0000 (01:26 +0100)
src/mediatomb.php

index 16b0ced56f5be5228a5ef788467e35fdb6c6410c..40861ae4bda2b348090ebb116030212c48ab6c60 100644 (file)
@@ -8,7 +8,7 @@ function handleRequestMediatomb($fullPath, $prefix)
     extract($mediatomb);
     $smt = new Services_MediaTomb($user, $pass, $host, $port);
 
-    $path = substr($fullPath, strlen($prefix));
+    $path = substr(urldecode($fullPath), strlen($prefix));
     $container = $smt->getContainerByPath($path);
     $listItems = array();
     addPreviousItem($listItems, $fullPath);
@@ -16,7 +16,7 @@ function handleRequestMediatomb($fullPath, $prefix)
     foreach ($container->getContainers() as $subContainer) {
         $listItems[] = getDirItem(
             $subContainer->title,
-            $fullPath . $subContainer->title . '/'
+            $fullPath . urlencode($subContainer->title) . '/'
         );
     }