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