]> source.dussan.org Git - nextcloud-server.git/commitdiff
properly encode path
authorGeorg Ehrke <developer@georgehrke.com>
Wed, 10 Jul 2013 09:25:28 +0000 (11:25 +0200)
committerGeorg Ehrke <developer@georgehrke.com>
Wed, 10 Jul 2013 10:30:20 +0000 (12:30 +0200)
apps/files/js/files.js
apps/files_trashbin/lib/trash.php
lib/helper.php

index 224167b99c14baaad794ec9ebea81aca7810fd52..06d193bf8f387b187056541f65b95019f4fd9aca 100644 (file)
@@ -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){
index e82a597c61ef33e5e7d6b52b2c91959f39f5a7a9..fb99fca5b3fdaf24c0c94f1ff5182277cf22efad 100644 (file)
@@ -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) ));
        }
 }
index 0a8962a5312c5b825110338418c23a662e9a3ebb..326f2567f99b6527b4b6b4231676ea0c6340b27c 100644 (file)
@@ -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) ));
        }
 
        /**