summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-21 10:05:00 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-21 10:05:00 +0200
commit3e499d1ac4fb18ee24c7a7aa032619a21e08a97f (patch)
tree49ae5ab95d1addbb3af79e576e85e8a6ba23b4e0
parent8485743e336c6995d80ce6d0f3021e9b6a54556a (diff)
parentf451ecb8d848636f37d8c80f1f12ab3c695c136f (diff)
downloadnextcloud-server-3e499d1ac4fb18ee24c7a7aa032619a21e08a97f.tar.gz
nextcloud-server-3e499d1ac4fb18ee24c7a7aa032619a21e08a97f.zip
Merge pull request #11675 from owncloud/urlencode-for-special-characters
URLEncode filenames to be compatible with special characters
-rw-r--r--apps/files/controller/apicontroller.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/controller/apicontroller.php b/apps/files/controller/apicontroller.php
index 01f9086c27d..89d24a5c47f 100644
--- a/apps/files/controller/apicontroller.php
+++ b/apps/files/controller/apicontroller.php
@@ -32,7 +32,7 @@ class ApiController extends Controller {
*
* @param int $x
* @param int $y
- * @param string $file
+ * @param string $file URL-encoded filename
* @return JSONResponse|DownloadResponse
*/
public function getThumbnail($x, $y, $file) {
@@ -41,9 +41,9 @@ class ApiController extends Controller {
}
try {
- $preview = new Preview('', 'files', $file, $x, $y, true);
+ $preview = new Preview('', 'files', urldecode($file), $x, $y, true);
echo($preview->showPreview('image/png'));
- return new DownloadResponse($file.'.png', 'image/png');
+ return new DownloadResponse(urldecode($file).'.png', 'image/png');
} catch (\Exception $e) {
return new JSONResponse('File not found.', Http::STATUS_NOT_FOUND);
}