Merge pull request #11675 from owncloud/urlencode-for-special-characters
URLEncode filenames to be compatible with special characters
This commit is contained in:
commit
3e499d1ac4
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue