summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-12-18 05:21:42 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-12-18 05:21:42 -0800
commit930a46e8e2696a54d79b389e7862af432202f0a4 (patch)
treeba4dd0dcd96ee6c3ef0ba95c94521ddc3907182f /apps
parent9c5a620c4f54b2f53373a41fdf0407c929c39660 (diff)
parent9a94c0755339daeda54cbd1084077cde26255a2a (diff)
downloadnextcloud-server-930a46e8e2696a54d79b389e7862af432202f0a4.tar.gz
nextcloud-server-930a46e8e2696a54d79b389e7862af432202f0a4.zip
Merge pull request #6469 from owncloud/enc_cleanup
remove duplicated code
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/lib/proxy.php5
-rw-r--r--apps/files_encryption/lib/util.php43
2 files changed, 1 insertions, 47 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 96667493a51..41f352d853a 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -209,10 +209,7 @@ class Proxy extends \OC_FileProxy {
$util = new Util($view, $userId);
- // get relative path
- $relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
-
- list($owner, $ownerPath) = $util->getUidAndFilename($relativePath);
+ list($owner, $ownerPath) = $util->getUidAndFilename($relPath);
// Delete keyfile & shareKey so it isn't orphaned
if (!Keymanager::deleteFileKey($view, $ownerPath)) {
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index d4aa4d31649..a3852312200 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -415,49 +415,6 @@ class Util {
}
/**
- * @brief Fetch the last lines of a file efficiently
- * @note Safe to use on large files; does not read entire file to memory
- * @note Derivative of http://tekkie.flashbit.net/php/tail-functionality-in-php
- */
- public function tail($filename, $numLines) {
-
- \OC_FileProxy::$enabled = false;
-
- $text = '';
- $pos = -1;
- $handle = $this->view->fopen($filename, 'r');
-
- while ($numLines > 0) {
-
- --$pos;
-
- if (fseek($handle, $pos, SEEK_END) !== 0) {
-
- rewind($handle);
- $numLines = 0;
-
- } elseif (fgetc($handle) === "\n") {
-
- --$numLines;
-
- }
-
- $block_size = (-$pos) % 8192;
- if ($block_size === 0 || $numLines === 0) {
-
- $text = fread($handle, ($block_size === 0 ? 8192 : $block_size)) . $text;
-
- }
- }
-
- fclose($handle);
-
- \OC_FileProxy::$enabled = true;
-
- return $text;
- }
-
- /**
* @brief Check if a given path identifies an encrypted file
* @param string $path
* @return boolean