summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-04-30 20:44:42 +0200
committerFlorin Peter <github@florin-peter.de>2013-04-30 20:44:42 +0200
commitfbbc76f281f50afa3072d99e4e0d413df835b3d3 (patch)
tree9b8dff5ea23da3ca6ed6984f8cec741143e42833
parentb1c4464eda73d0c6674a1635c7f8c8629414ecaa (diff)
downloadnextcloud-server-fbbc76f281f50afa3072d99e4e0d413df835b3d3.tar.gz
nextcloud-server-fbbc76f281f50afa3072d99e4e0d413df835b3d3.zip
fix for sharing files
-rw-r--r--apps/files_encryption/lib/proxy.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 23290b5b20b..50f30594b42 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -153,9 +153,9 @@ class Proxy extends \OC_FileProxy {
$data = $encData;
// Update the file cache with file info
- \OC\Files\Filesystem::putFileInfo( $path, array( 'encrypted'=>true, 'size' => $size ), '' );
-
- // Re-enable proxy - our work is done
+ \OC\Files\Filesystem::putFileInfo( $filePath, array( 'encrypted'=>true, 'size' => strlen($size), 'unencrypted_size' => $size), '' );
+
+ // Re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
}
@@ -437,24 +437,25 @@ class Proxy extends \OC_FileProxy {
$fileInfo = \OC\Files\Filesystem::getFileInfo($path_f);
// if file is encrypted return real file size
- if (is_array($fileInfo) && $fileInfo['encrypted'] == 1) {
+ if (is_array($fileInfo) && $fileInfo['encrypted'] === true) {
$size = $fileInfo['unencrypted_size'];
} else {
// self healing if file was removed from file cache
- $userId = \OCP\User::getUser();
- $util = new Util( $view, $userId );
- $fixSize = $util->getFileSize($path);
- if($fixSize > 0) {
- $size = $fixSize;
-
- $fileInfo['encrypted'] = 1;
- $fileInfo['unencrypted_size'] = $size;
-
- // put file info
- $view->putFileInfo( $path, $fileInfo );
+ if(is_array($fileInfo)) {
+ $userId = \OCP\User::getUser();
+ $util = new Util( $view, $userId );
+ $fixSize = $util->getFileSize($path);
+ if($fixSize > 0) {
+ $size = $fixSize;
+
+ $fileInfo['encrypted'] = 1;
+ $fileInfo['unencrypted_size'] = $size;
+
+ // put file info
+ $view->putFileInfo( $path_f, $fileInfo );
+ }
}
}
-
return $size;
}