From c706938dba93562cfea0c0932942510e9dfff750 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Sep 2013 20:50:58 +0200 Subject: [PATCH] escape spaces in folders --- src/imagestore/Controller/Api/Apps.php | 4 +++- src/imagestore/Controller/Api/Playlists.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/imagestore/Controller/Api/Apps.php b/src/imagestore/Controller/Api/Apps.php index 32b6ca6..39e7a17 100644 --- a/src/imagestore/Controller/Api/Apps.php +++ b/src/imagestore/Controller/Api/Apps.php @@ -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'); diff --git a/src/imagestore/Controller/Api/Playlists.php b/src/imagestore/Controller/Api/Playlists.php index effb905..d35d786 100644 --- a/src/imagestore/Controller/Api/Playlists.php +++ b/src/imagestore/Controller/Api/Playlists.php @@ -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', -- 2.30.2