]> source.dussan.org Git - nextcloud-server.git/commitdiff
hack for file download
authorBartek Przybylski <bart.p.pl@gmail.com>
Wed, 6 Jun 2012 20:20:56 +0000 (22:20 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Sun, 10 Jun 2012 11:16:06 +0000 (13:16 +0200)
apps/gallery/lib/tiles.php

index c2d7fede7869fd8caef4482582783cfd1aa75539..3805b6dd25cdc3ef608ff2d6aaa44b0e44423e98 100644 (file)
@@ -96,7 +96,9 @@ class TileSingle extends TileBase {
   }
   
   public function get($extra = '') {
-    return '<a rel="images" href="?app=files&getfile=download.php?file='.urlencode($this->getPath()).'"><img rel="images" src="'.GET_THUMBNAIL_PATH.urlencode($this->getPath()).'" '.$extra.'></a>';
+    //  !HACK! file path needs to be encoded twice because files app decode twice url, so any special chars like + or & in filename
+    //  !HACK! will result in failing of opening them 
+    return '<a rel="images" href="?app=files&getfile=download.php?file='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.GET_THUMBNAIL_PATH.urlencode($this->getPath()).'" '.$extra.'></a>';
   }
   
   public function getMiniatureSrc() {