diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-04-12 14:30:02 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-04-12 14:30:02 +0200 |
commit | 02d1f86a535410e26d20d860f800ff069a6aa25c (patch) | |
tree | 45b3d7f6b313da559344d2006e33b0f776f0be62 | |
parent | f87229ddafff57980bfc93f52d6aff3427e9a0e9 (diff) | |
download | nextcloud-server-02d1f86a535410e26d20d860f800ff069a6aa25c.tar.gz nextcloud-server-02d1f86a535410e26d20d860f800ff069a6aa25c.zip |
fix some confusion about paths relative to the files dir and to the data dir
-rw-r--r-- | apps/files_encryption/lib/stream.php | 11 | ||||
-rw-r--r-- | apps/files_encryption/lib/util.php | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index 3bad43de2e0..d269a562404 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -51,7 +51,7 @@ class Stream { // TODO: make all below properties private again once unit testing is // configured correctly - public $rawPath; // The raw path received by stream_open + public $rawPath; // The raw path relative to the data dir public $relPath; // rel path to users file dir private $userId; private $handle; // Resource returned by fopen @@ -77,12 +77,11 @@ class Stream { } - // Strip identifier text from path - $this->rawPath = str_replace( 'crypt://', '', $path ); + // Strip identifier text from path, this gives us the path relative to data/<user>/files + $this->relPath = str_replace( 'crypt://', '', $path ); - // Set file path relative to user files dir (7 = string length of '/files/') - $this->relPath = substr($this->rawPath, strlen($this->userId)+7); - //$this->relPath = $this->userId . '/files/' . $this->rawPath; + // rawPath is relative to the data directory + $this->rawPath = $this->userId . '/files/' . $this->relPath; if ( dirname( $this->rawPath ) == 'streams' diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 4605c0f597d..6e0aeb96e96 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -344,7 +344,7 @@ class Util { // If the file is not encrypted } else { - $found['plain'][] = array( 'name' => $file, 'path' => $filePath ); + $found['plain'][] = array( 'name' => $file, 'path' => $relPath ); } |