diff options
author | Bartek Przybylski <bart.p.pl@gmail.com> | 2012-06-09 15:26:26 +0200 |
---|---|---|
committer | Bartek Przybylski <bart.p.pl@gmail.com> | 2012-06-09 15:26:26 +0200 |
commit | 43501309e336ac0268b6e9b4b3c6f5b0f05f7056 (patch) | |
tree | f596c1a65b537769ba874e721fd54e6af12eb9d6 /lib/image.php | |
parent | 120997112c7acf490171d07ec32cdd6d091db9c2 (diff) | |
download | nextcloud-server-43501309e336ac0268b6e9b4b3c6f5b0f05f7056.tar.gz nextcloud-server-43501309e336ac0268b6e9b4b3c6f5b0f05f7056.zip |
add function in filesystem to strip webroot
Diffstat (limited to 'lib/image.php')
-rw-r--r-- | lib/image.php | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/image.php b/lib/image.php index 41e8c744d8c..d72960101f0 100644 --- a/lib/image.php +++ b/lib/image.php @@ -409,12 +409,7 @@ class OC_Image { default: // this is mostly file created from encrypted file - $datadir = \OCP\Config::getSystemValue('datadirectory').'/'.\OC_User::getUser().'/files'; - $newimgpath = $imagepath; - if (strncmp($newimgpath, $datadir, strlen($datadir)) == 0) { - $newimgpath = substr($imagepath, strlen($datadir)); - } - $this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents($newimgpath)); + $this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents(\OC_Filesystem::getLocalPath($newimgpath))); $itype = IMAGETYPE_PNG; OC_Log::write('core','OC_Image->loadFromFile, Default', OC_Log::DEBUG); break; |