escape spaces in folders
authorChristian Weiske <cweiske@cweiske.de>
Fri, 13 Sep 2013 18:50:58 +0000 (20:50 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 13 Sep 2013 18:50:58 +0000 (20:50 +0200)
src/imagestore/Controller/Api/Apps.php
src/imagestore/Controller/Api/Playlists.php

index 32b6ca6..39e7a17 100644 (file)
@@ -5,7 +5,9 @@ class Controller_Api_Apps extends Controller_Api_ImageBase
 {
     public function handle($data)
     {
-        $path = str_replace('-.-', '/', $data);
+        $path = str_replace(
+            array('-.-', '+'), array('/', ' '), $data
+        );
         $fullPath = $GLOBALS['imagestore']['basedir'] . $path;
         if (!is_dir($fullPath)) {
             return $this->error('404 Not Found', 'Path not found');
index effb905..d35d786 100644 (file)
@@ -39,7 +39,8 @@ class Controller_Api_Playlists extends Controller_Api_ImageBase
 
             foreach ($arDirs as $dirInfo) {
                 $uuid = str_replace(
-                    '/', '-.-', $this->getRelPath($dirInfo->getPathname())
+                    array('/', ' '), array('-.-', '+'),
+                    $this->getRelPath($dirInfo->getPathname())
                 );
                 $playlists->games[] = (object) array(
                     'content_rating' => 'Everyone',