]> source.dussan.org Git - nextcloud-server.git/commitdiff
removing app access check, fix title for links in tiles
authorBartek Przybylski <bart.p.pl@gmail.com>
Sat, 9 Jun 2012 13:12:28 +0000 (15:12 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Sun, 10 Jun 2012 11:18:55 +0000 (13:18 +0200)
apps/gallery/lib/managers.php
apps/gallery/lib/tiles.php
lib/image.php

index 41300058936556ca426b6db480b298fe72a3868f..f9a67b8b117b5811d2c01f226ecdb362433c29b1 100644 (file)
@@ -4,9 +4,6 @@ namespace OC\Pictures;
 
 require_once('lib/base.php');
 
-\OCP\JSON::checkLoggedIn();
-\OCP\JSON::checkAppEnabled('gallery');
-
 class DatabaseManager {
        private static $instance = null;
        const TAG = 'DatabaseManager';
index f1961cb72e5f84d963ff73b147a0ed70ecd14172..e43c99bb76a0cee7bd879d4c9e6d22f9deb19135 100644 (file)
@@ -95,7 +95,7 @@ class TileSingle extends TileBase {
        public function get($extra = '') {
                //      !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" title="'.basename($this->getPath()).'" href="'.\OCP\Util::linkTo('files', 'download.php').'?file='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
+               return '<a rel="images" title="'.htmlentities(basename($this->getPath())).'" href="'.\OCP\Util::linkTo('files', 'download.php').'?file='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
        }
        
        public function getMiniatureSrc() {
index 3150631cc348c7733b7a69a961d28ce6ed790d0c..f4c944e10d6f2dc081ff3b13de3b3fb69558b1f9 100644 (file)
@@ -400,7 +400,11 @@ class OC_Image {
                                break;
                        */
                        default:
-                               $this->resource = imagecreatefromstring(file_get_contents($imagepath));
+                       error_log($imagepath);
+                       error_log(\OC_Filesystem::getInternalPath($imagepath));
+                       error_log(\OC_Filesystem::getLocalFile($imagepath));
+                               // this is mostly file created from encrypted file
+                               $this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents(\OC_Filesystem::getInternalPath($imagepath)));
                                $itype = IMAGETYPE_PNG;
                                OC_Log::write('core','OC_Image->loadFromFile, Default', OC_Log::DEBUG);
                                break;