escape spaces in folders
[ouya-imagestore.git] / src / imagestore / Controller / Api / Apps.php
index 32b6ca68d967d349c4303a5c62907ca1a70d71b1..39e7a17045b1c9a84a2ccdd0fbae43582f3b5b02 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');