summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-07-10 11:25:28 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-07-10 12:30:20 +0200
commitcf449d42e87b21dff0de35c394031c5fa28b56aa (patch)
tree6470fa72160bdfa6a2f44650d6a9b5a23e362ec2
parent8eefaba719160eb92dcb6747b5e70b7e04736cea (diff)
downloadnextcloud-server-cf449d42e87b21dff0de35c394031c5fa28b56aa.tar.gz
nextcloud-server-cf449d42e87b21dff0de35c394031c5fa28b56aa.zip
properly encode path
-rw-r--r--apps/files/js/files.js2
-rw-r--r--apps/files_trashbin/lib/trash.php2
-rw-r--r--lib/helper.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 224167b99c1..06d193bf8f3 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -960,7 +960,7 @@ function getMimeIcon(mime, ready){
getMimeIcon.cache={};
function getPreviewIcon(path, ready){
- ready(OC.Router.generate('core_ajax_preview', {file:path, x:44, y:44}));
+ ready(OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:44, y:44}));
}
function getUniqueName(name){
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index e82a597c61e..fb99fca5b3f 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -852,6 +852,6 @@ class Trashbin {
}
public static function preview_icon($path) {
- return \OC_Helper::linkToRoute( 'core_ajax_trashbin_preview', array('x' => 44, 'y' => 44, 'file' => $path));
+ return \OC_Helper::linkToRoute( 'core_ajax_trashbin_preview', array('x' => 44, 'y' => 44, 'file' => urlencode($path) ));
}
}
diff --git a/lib/helper.php b/lib/helper.php
index 0a8962a5312..326f2567f99 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -231,7 +231,7 @@ class OC_Helper {
* Returns the path to the preview of the file.
*/
public static function previewIcon($path) {
- return self::linkToRoute( 'core_ajax_preview', array('x' => 44, 'y' => 44, 'file' => $path));
+ return self::linkToRoute( 'core_ajax_preview', array('x' => 44, 'y' => 44, 'file' => urlencode($path) ));
}
/**