aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/encryption/lib/Crypto/Encryption.php1
-rw-r--r--apps/files_external/3rdparty/composer.json2
-rw-r--r--apps/files_external/3rdparty/composer.lock12
-rw-r--r--apps/files_external/3rdparty/composer/autoload_classmap.php9
-rw-r--r--apps/files_external/3rdparty/composer/autoload_static.php9
-rw-r--r--apps/files_external/3rdparty/composer/installed.json12
-rw-r--r--apps/files_external/3rdparty/icewind/streams/.travis.yml7
-rw-r--r--apps/files_external/3rdparty/icewind/streams/README.md4
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php106
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/Wrapper.php14
-rw-r--r--apps/files_sharing/js/public.js19
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php1
-rw-r--r--apps/workflowengine/js/requestuseragentplugin.js19
-rw-r--r--core/img/actions/checkmark-white.svg1
-rw-r--r--core/img/actions/confirm-white.svg1
-rw-r--r--core/img/actions/info-white.svg1
-rw-r--r--lib/private/App/CodeChecker/CodeChecker.php2
-rw-r--r--lib/private/Files/Stream/Encryption.php19
-rw-r--r--resources/app-info.xsd1
-rw-r--r--tests/lib/Files/Stream/EncryptionTest.php11
20 files changed, 198 insertions, 53 deletions
diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php
index bd75e4ae10c..3f6001cab74 100644
--- a/apps/encryption/lib/Crypto/Encryption.php
+++ b/apps/encryption/lib/Crypto/Encryption.php
@@ -254,7 +254,6 @@ class Encryption implements IEncryptionModule {
public function end($path, $position = 0) {
$result = '';
if ($this->isWriteOperation) {
- $this->keyManager->setVersion($path, $this->version + 1, new View());
// in case of a part file we remember the new signature versions
// the version will be set later on update.
// This way we make sure that other apps listening to the pre-hooks
diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json
index 537159bbf66..caf87983c50 100644
--- a/apps/files_external/3rdparty/composer.json
+++ b/apps/files_external/3rdparty/composer.json
@@ -8,7 +8,7 @@
"classmap-authoritative": true
},
"require": {
- "icewind/streams": "0.5.2",
+ "icewind/streams": "0.6.1",
"icewind/smb": "3.0.0"
}
}
diff --git a/apps/files_external/3rdparty/composer.lock b/apps/files_external/3rdparty/composer.lock
index 7bfcdba3d2f..2339220ffbc 100644
--- a/apps/files_external/3rdparty/composer.lock
+++ b/apps/files_external/3rdparty/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "0235b6f1a4131c9312afef7a58f3a80e",
+ "content-hash": "1465c8a4b4139e514086d5803d90af2d",
"packages": [
{
"name": "icewind/smb",
@@ -49,16 +49,16 @@
},
{
"name": "icewind/streams",
- "version": "0.5.2",
+ "version": "0.6.1",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
- "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e"
+ "reference": "0a78597117d8a02937ea05206f219294449fb06e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/icewind1991/Streams/zipball/6bfd2fdbd99319f5e010d0a684409189a562cb1e",
- "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e",
+ "url": "https://api.github.com/repos/icewind1991/Streams/zipball/0a78597117d8a02937ea05206f219294449fb06e",
+ "reference": "0a78597117d8a02937ea05206f219294449fb06e",
"shasum": ""
},
"require": {
@@ -86,7 +86,7 @@
}
],
"description": "A set of generic stream wrappers",
- "time": "2016-12-02T14:21:23+00:00"
+ "time": "2018-04-24T09:07:38+00:00"
}
],
"packages-dev": [],
diff --git a/apps/files_external/3rdparty/composer/autoload_classmap.php b/apps/files_external/3rdparty/composer/autoload_classmap.php
index d2e658d9f61..6c5f86a5796 100644
--- a/apps/files_external/3rdparty/composer/autoload_classmap.php
+++ b/apps/files_external/3rdparty/composer/autoload_classmap.php
@@ -51,14 +51,6 @@ return array(
'Icewind\\SMB\\Native\\NativeWriteStream' => $vendorDir . '/icewind/smb/src/Native/NativeWriteStream.php',
'Icewind\\SMB\\ServerFactory' => $vendorDir . '/icewind/smb/src/ServerFactory.php',
'Icewind\\SMB\\System' => $vendorDir . '/icewind/smb/src/System.php',
- 'Icewind\\SMB\\Test\\AbstractShareTest' => $vendorDir . '/icewind/smb/tests/AbstractShareTest.php',
- 'Icewind\\SMB\\Test\\NativeShareTest' => $vendorDir . '/icewind/smb/tests/NativeShareTest.php',
- 'Icewind\\SMB\\Test\\NativeStreamTest' => $vendorDir . '/icewind/smb/tests/NativeStreamTest.php',
- 'Icewind\\SMB\\Test\\NotifyHandlerTest' => $vendorDir . '/icewind/smb/tests/NotifyHandlerTest.php',
- 'Icewind\\SMB\\Test\\ParserTest' => $vendorDir . '/icewind/smb/tests/ParserTest.php',
- 'Icewind\\SMB\\Test\\ServerTest' => $vendorDir . '/icewind/smb/tests/ServerTest.php',
- 'Icewind\\SMB\\Test\\ShareTest' => $vendorDir . '/icewind/smb/tests/ShareTest.php',
- 'Icewind\\SMB\\Test\\TestCase' => $vendorDir . '/icewind/smb/tests/TestCase.php',
'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php',
'Icewind\\SMB\\Wrapped\\Connection' => $vendorDir . '/icewind/smb/src/Wrapped/Connection.php',
'Icewind\\SMB\\Wrapped\\ErrorCodes' => $vendorDir . '/icewind/smb/src/Wrapped/ErrorCodes.php',
@@ -69,6 +61,7 @@ return array(
'Icewind\\SMB\\Wrapped\\Server' => $vendorDir . '/icewind/smb/src/Wrapped/Server.php',
'Icewind\\SMB\\Wrapped\\Share' => $vendorDir . '/icewind/smb/src/Wrapped/Share.php',
'Icewind\\Streams\\CallbackWrapper' => $vendorDir . '/icewind/streams/src/CallbackWrapper.php',
+ 'Icewind\\Streams\\CountWrapper' => $vendorDir . '/icewind/streams/src/CountWrapper.php',
'Icewind\\Streams\\Directory' => $vendorDir . '/icewind/streams/src/Directory.php',
'Icewind\\Streams\\DirectoryFilter' => $vendorDir . '/icewind/streams/src/DirectoryFilter.php',
'Icewind\\Streams\\DirectoryWrapper' => $vendorDir . '/icewind/streams/src/DirectoryWrapper.php',
diff --git a/apps/files_external/3rdparty/composer/autoload_static.php b/apps/files_external/3rdparty/composer/autoload_static.php
index 3234d89e5b9..658c947c9c2 100644
--- a/apps/files_external/3rdparty/composer/autoload_static.php
+++ b/apps/files_external/3rdparty/composer/autoload_static.php
@@ -81,14 +81,6 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
'Icewind\\SMB\\Native\\NativeWriteStream' => __DIR__ . '/..' . '/icewind/smb/src/Native/NativeWriteStream.php',
'Icewind\\SMB\\ServerFactory' => __DIR__ . '/..' . '/icewind/smb/src/ServerFactory.php',
'Icewind\\SMB\\System' => __DIR__ . '/..' . '/icewind/smb/src/System.php',
- 'Icewind\\SMB\\Test\\AbstractShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/AbstractShareTest.php',
- 'Icewind\\SMB\\Test\\NativeShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeShareTest.php',
- 'Icewind\\SMB\\Test\\NativeStreamTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeStreamTest.php',
- 'Icewind\\SMB\\Test\\NotifyHandlerTest' => __DIR__ . '/..' . '/icewind/smb/tests/NotifyHandlerTest.php',
- 'Icewind\\SMB\\Test\\ParserTest' => __DIR__ . '/..' . '/icewind/smb/tests/ParserTest.php',
- 'Icewind\\SMB\\Test\\ServerTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerTest.php',
- 'Icewind\\SMB\\Test\\ShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/ShareTest.php',
- 'Icewind\\SMB\\Test\\TestCase' => __DIR__ . '/..' . '/icewind/smb/tests/TestCase.php',
'Icewind\\SMB\\TimeZoneProvider' => __DIR__ . '/..' . '/icewind/smb/src/TimeZoneProvider.php',
'Icewind\\SMB\\Wrapped\\Connection' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/Connection.php',
'Icewind\\SMB\\Wrapped\\ErrorCodes' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/ErrorCodes.php',
@@ -99,6 +91,7 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
'Icewind\\SMB\\Wrapped\\Server' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/Server.php',
'Icewind\\SMB\\Wrapped\\Share' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/Share.php',
'Icewind\\Streams\\CallbackWrapper' => __DIR__ . '/..' . '/icewind/streams/src/CallbackWrapper.php',
+ 'Icewind\\Streams\\CountWrapper' => __DIR__ . '/..' . '/icewind/streams/src/CountWrapper.php',
'Icewind\\Streams\\Directory' => __DIR__ . '/..' . '/icewind/streams/src/Directory.php',
'Icewind\\Streams\\DirectoryFilter' => __DIR__ . '/..' . '/icewind/streams/src/DirectoryFilter.php',
'Icewind\\Streams\\DirectoryWrapper' => __DIR__ . '/..' . '/icewind/streams/src/DirectoryWrapper.php',
diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json
index 3b2870a13bf..707b876e588 100644
--- a/apps/files_external/3rdparty/composer/installed.json
+++ b/apps/files_external/3rdparty/composer/installed.json
@@ -44,17 +44,17 @@
},
{
"name": "icewind/streams",
- "version": "0.5.2",
- "version_normalized": "0.5.2.0",
+ "version": "0.6.1",
+ "version_normalized": "0.6.1.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
- "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e"
+ "reference": "0a78597117d8a02937ea05206f219294449fb06e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/icewind1991/Streams/zipball/6bfd2fdbd99319f5e010d0a684409189a562cb1e",
- "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e",
+ "url": "https://api.github.com/repos/icewind1991/Streams/zipball/0a78597117d8a02937ea05206f219294449fb06e",
+ "reference": "0a78597117d8a02937ea05206f219294449fb06e",
"shasum": ""
},
"require": {
@@ -64,7 +64,7 @@
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "v1.0.0"
},
- "time": "2016-12-02T14:21:23+00:00",
+ "time": "2018-04-24T09:07:38+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
diff --git a/apps/files_external/3rdparty/icewind/streams/.travis.yml b/apps/files_external/3rdparty/icewind/streams/.travis.yml
index d2e1afaad67..68efcd2c744 100644
--- a/apps/files_external/3rdparty/icewind/streams/.travis.yml
+++ b/apps/files_external/3rdparty/icewind/streams/.travis.yml
@@ -4,11 +4,8 @@ php:
- 5.5
- 5.6
- 7.0
- - hhvm
-
-matrix:
- allow_failures:
- - php: hhvm # due to facebook/hhvm#3321
+ - 7.1
+ - 7.2
env:
global:
diff --git a/apps/files_external/3rdparty/icewind/streams/README.md b/apps/files_external/3rdparty/icewind/streams/README.md
index ca13db28e44..88ab2dd92a3 100644
--- a/apps/files_external/3rdparty/icewind/streams/README.md
+++ b/apps/files_external/3rdparty/icewind/streams/README.md
@@ -1,4 +1,4 @@
-#Streams#
+# Streams #
[![Build Status](https://travis-ci.org/icewind1991/Streams.svg?branch=master)](https://travis-ci.org/icewind1991/Streams)
[![Coverage Status](https://img.shields.io/coveralls/icewind1991/Streams.svg)](https://coveralls.io/r/icewind1991/Streams?branch=master)
@@ -6,7 +6,7 @@
Generic stream wrappers for php.
-##CallBackWrapper##
+## CallBackWrapper ##
A `CallBackWrapper` can be used to register callbacks on read, write and closing of the stream,
it wraps an existing stream and can thus be used for any stream in php
diff --git a/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php
new file mode 100644
index 00000000000..8b86ab9187c
--- /dev/null
+++ b/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Icewind\Streams;
+
+/**
+ * Wrapper that counts the amount of data read and written
+ *
+ * The following options should be passed in the context when opening the stream
+ * [
+ * 'callback' => [
+ * 'source' => resource
+ * 'callback' => function($readCount, $writeCount){}
+ * ]
+ * ]
+ *
+ * The callback will be called when the stream is closed
+ */
+class CountWrapper extends Wrapper {
+ /**
+ * @var int
+ */
+ protected $readCount = 0;
+
+ /**
+ * @var int
+ */
+ protected $writeCount = 0;
+
+ /**
+ * @var callable
+ */
+ protected $callback;
+
+ /**
+ * Wraps a stream with the provided callbacks
+ *
+ * @param resource $source
+ * @param callable $callback
+ * @return resource
+ *
+ * @throws \BadMethodCallException
+ */
+ public static function wrap($source, $callback) {
+ if (!is_callable($callback)) {
+ throw new \InvalidArgumentException('Invalid or missing callback');
+ }
+ $context = stream_context_create(array(
+ 'count' => array(
+ 'source' => $source,
+ 'callback' => $callback
+ )
+ ));
+ return Wrapper::wrapSource($source, $context, 'callback', '\Icewind\Streams\CountWrapper');
+ }
+
+ protected function open() {
+ $context = $this->loadContext('count');
+ $this->callback = $context['callback'];
+ return true;
+ }
+
+ public function dir_opendir($path, $options) {
+ return $this->open();
+ }
+
+ public function stream_open($path, $mode, $options, &$opened_path) {
+ return $this->open();
+ }
+
+ public function stream_read($count) {
+ $result = parent::stream_read($count);
+ $this->readCount += strlen($result);
+ return $result;
+ }
+
+ public function stream_write($data) {
+ $result = parent::stream_write($data);
+ $this->writeCount += strlen($data);
+ return $result;
+ }
+
+ public function stream_close() {
+ $result = parent::stream_close();
+ call_user_func($this->callback, $this->readCount, $this->writeCount);
+ return $result;
+ }
+}
diff --git a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
index 8e52eff9a08..babd2c1a0b3 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
@@ -26,12 +26,15 @@ abstract class Wrapper implements File, Directory {
protected $source;
protected static function wrapSource($source, $context, $protocol, $class) {
+ if (!is_resource($source)) {
+ throw new \BadMethodCallException();
+ }
try {
stream_wrapper_register($protocol, $class);
- if (@rewinddir($source) === false) {
- $wrapped = fopen($protocol . '://', 'r+', false, $context);
- } else {
+ if (self::isDirectoryHandle($source)) {
$wrapped = opendir($protocol . '://', $context);
+ } else {
+ $wrapped = fopen($protocol . '://', 'r+', false, $context);
}
} catch (\BadMethodCallException $e) {
stream_wrapper_unregister($protocol);
@@ -41,6 +44,11 @@ abstract class Wrapper implements File, Directory {
return $wrapped;
}
+ protected static function isDirectoryHandle($resource) {
+ $meta = stream_get_meta_data($resource);
+ return $meta['stream_type'] == 'dir';
+ }
+
/**
* Load the source from the stream context and return the context options
*
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 998964b2d8a..64ffe8bbf2e 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -72,7 +72,24 @@ OCA.Sharing.PublicApp = {
fileActions: fileActions,
detailsViewEnabled: false,
filesClient: filesClient,
- enableUpload: true
+ enableUpload: true,
+ multiSelectMenu: [
+ {
+ name: 'copyMove',
+ displayName: t('files', 'Move or copy'),
+ iconClass: 'icon-external',
+ },
+ {
+ name: 'download',
+ displayName: t('files', 'Download'),
+ iconClass: 'icon-download',
+ },
+ {
+ name: 'delete',
+ displayName: t('files', 'Delete'),
+ iconClass: 'icon-delete',
+ }
+ ]
}
);
this.files = OCA.Files.Files;
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 6ebffed2b58..9594d6e71f5 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -399,6 +399,7 @@ class ShareController extends AuthPublicShareController {
\OCP\Util::addScript('files', 'fileinfomodel');
\OCP\Util::addScript('files', 'newfilemenu');
\OCP\Util::addScript('files', 'files');
+ \OCP\Util::addScript('files', 'filemultiselectmenu');
\OCP\Util::addScript('files', 'filelist');
\OCP\Util::addScript('files', 'keyboardshortcuts');
}
diff --git a/apps/workflowengine/js/requestuseragentplugin.js b/apps/workflowengine/js/requestuseragentplugin.js
index 973f66cba31..881ea4b8ac7 100644
--- a/apps/workflowengine/js/requestuseragentplugin.js
+++ b/apps/workflowengine/js/requestuseragentplugin.js
@@ -44,7 +44,7 @@
var placeholder = 'Mozilla/5.0 User Agent';
- if (check['operator'] === 'matches' || check['operator'] === '!matches') {
+ if (check.operator === 'matches' || check.operator === '!matches') {
placeholder = '/^Mozilla\\/5\\.0 (.*)$/i';
}
@@ -56,8 +56,8 @@
placement: 'bottom'
});
- if (check['operator'] === 'matches' || check['operator'] === '!matches') {
- if (this._validateRegex(check['value'])) {
+ if (check.operator === 'matches' || check.operator === '!matches') {
+ if (this._validateRegex(check.value)) {
$(element).removeClass('invalid-input');
} else {
$(element).addClass('invalid-input');
@@ -70,21 +70,22 @@
children: [
{id: 'android', text: t('workflowengine', 'Android client')},
{id: 'ios', text: t('workflowengine', 'iOS client')},
- {id: 'desktop', text: t('workflowengine', 'Desktop client')}
+ {id: 'desktop', text: t('workflowengine', 'Desktop client')},
+ {id: 'mail', text: t('workflowengine', 'Thunderbird & Outlook addons')}
]
}
];
- if (this.predefinedValues.indexOf(check['value']) === -1) {
+ if (this.predefinedValues.indexOf(check.value) === -1) {
data.unshift({
- id: check['value'],
- text: check['value']
- })
+ id: check.value,
+ text: check.value
+ });
}
$(element).select2({
data: data,
createSearchChoice: function(term) {
- if (self.predefinedValues.indexOf(check['value']) === -1) {
+ if (self.predefinedValues.indexOf(check.value) === -1) {
return {
id: term,
text: term
diff --git a/core/img/actions/checkmark-white.svg b/core/img/actions/checkmark-white.svg
new file mode 100644
index 00000000000..6190902ea2d
--- /dev/null
+++ b/core/img/actions/checkmark-white.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"><path d="m2.35 7.3 4 4l7.3-7.3" stroke="white" stroke-width="2" fill="none"/></svg>
diff --git a/core/img/actions/confirm-white.svg b/core/img/actions/confirm-white.svg
new file mode 100644
index 00000000000..98a41adefe5
--- /dev/null
+++ b/core/img/actions/confirm-white.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 16 16" width="16" version="1.1" height="16"><path fill="#fff" d="m8.5 0.5c-0.8974 0-1.3404 1.0909-0.6973 1.7168l4.7837 4.7832h-11.573c-1.3523-0.019125-1.3523 2.0191 0 2h11.572l-4.7832 4.7832c-0.98163 0.94251 0.47155 2.3957 1.4141 1.4141l6.4911-6.49c0.387-0.3878 0.391-1.0228 0-1.414l-6.4906-6.4903c-0.1883-0.1935-0.4468-0.30268-0.7168-0.3027z"/></svg>
diff --git a/core/img/actions/info-white.svg b/core/img/actions/info-white.svg
new file mode 100644
index 00000000000..92f6e44add2
--- /dev/null
+++ b/core/img/actions/info-white.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 16 16" width="16" height="16"><path d="M5 7.474c.155.382.325.69.644.246.407-.268 1.76-1.427 1.662-.342-.368 2.017-.834 4.017-1.17 6.04-.393 1.114.634 2.067 1.637 1.31 1.078-.502 1.99-1.287 2.927-2.01-.144-.323-.25-.79-.596-.347-.468.24-1.47 1.318-1.696.472.315-2.18.975-4.295 1.365-6.462.397-1.005-.364-2.223-1.4-1.363C7.117 5.634 6.083 6.6 5 7.474zM9.46.005C8.15-.017 7.553 2.147 8.815 2.68c1.023.378 2.077-.714 1.79-1.75-.098-.542-.598-.97-1.147-.93z" fill="#fff"/></svg>
diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php
index 456a78aa122..d2f6d7451b4 100644
--- a/lib/private/App/CodeChecker/CodeChecker.php
+++ b/lib/private/App/CodeChecker/CodeChecker.php
@@ -82,7 +82,7 @@ class CodeChecker extends BasicEmitter {
public function analyseFolder(string $appId, string $folder): array {
$errors = [];
- $excludedDirectories = ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test'];
+ $excludedDirectories = ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test', 'build'];
if ($appId === 'password_policy') {
$excludedDirectories[] = 'lists';
}
diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php
index 65d379c0289..3c884a99ae7 100644
--- a/lib/private/Files/Stream/Encryption.php
+++ b/lib/private/Files/Stream/Encryption.php
@@ -102,6 +102,9 @@ class Encryption extends Wrapper {
/** @var array */
protected $expectedContextProperties;
+ /** @var bool */
+ protected $fileUpdated;
+
public function __construct() {
$this->expectedContextProperties = array(
'source',
@@ -235,6 +238,7 @@ class Encryption extends Wrapper {
$this->position = 0;
$this->cache = '';
$this->writeFlag = false;
+ $this->fileUpdated = false;
$this->unencryptedBlockSize = $this->encryptionModule->getUnencryptedBlockSize($this->signed);
if (
@@ -313,7 +317,6 @@ class Encryption extends Wrapper {
}
public function stream_write($data) {
-
$length = 0;
// loop over $data to fit it in 6126 sized unencrypted blocks
while (isset($data[0])) {
@@ -333,6 +336,7 @@ class Encryption extends Wrapper {
// switch the writeFlag so flush() will write the block
$this->writeFlag = true;
+ $this->fileUpdated = true;
// determine the relative position in the current block
$blockPosition = ($this->position % $this->unencryptedBlockSize);
@@ -414,7 +418,18 @@ class Encryption extends Wrapper {
}
$this->encryptionStorage->updateUnencryptedSize($this->fullPath, $this->unencryptedSize);
}
- return parent::stream_close();
+ $result = parent::stream_close();
+
+ if ($this->fileUpdated) {
+ $cache = $this->storage->getCache();
+ $cacheEntry = $cache->get($this->internalPath);
+ if ($cacheEntry) {
+ $version = $cacheEntry['encryptedVersion'] + 1;
+ $cache->update($cacheEntry->getId(), ['encrypted' => $version, 'encryptedVersion' => $version]);
+ }
+ }
+
+ return $result;
}
/**
diff --git a/resources/app-info.xsd b/resources/app-info.xsd
index 4460b0f63b9..516d984674e 100644
--- a/resources/app-info.xsd
+++ b/resources/app-info.xsd
@@ -344,6 +344,7 @@
<xs:enumeration value="social"/>
<xs:enumeration value="tools"/>
<xs:enumeration value="games"/>
+ <xs:enumeration value="search"/>
</xs:restriction>
</xs:simpleType>
diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php
index 983428ee51d..d7a5554acfd 100644
--- a/tests/lib/Files/Stream/EncryptionTest.php
+++ b/tests/lib/Files/Stream/EncryptionTest.php
@@ -2,8 +2,10 @@
namespace Test\Files\Stream;
+use OC\Files\Cache\CacheEntry;
use OC\Files\View;
use OC\Memcache\ArrayCache;
+use OCP\Files\Cache\ICache;
use OCP\IConfig;
class EncryptionTest extends \Test\TestCase {
@@ -26,6 +28,7 @@ class EncryptionTest extends \Test\TestCase {
$header = [];
$uid = '';
$this->encryptionModule = $this->buildMockModule();
+ $cache = $this->createMock(ICache::class);
$storage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
$encStorage = $this->getMockBuilder('\OC\Files\Storage\Wrapper\Encryption')
@@ -49,6 +52,13 @@ class EncryptionTest extends \Test\TestCase {
$util->expects($this->any())
->method('getUidAndFilename')
->willReturn(['user1', $internalPath]);
+ $storage->expects($this->any())->method('getCache')->willReturn($cache);
+ $entry = new CacheEntry([
+ 'fileid' => 5,
+ 'encryptedVersion' => 2,
+ ]);
+ $cache->expects($this->any())->method('get')->willReturn($entry );
+ $cache->expects($this->any())->method('update')->with(5, ['encrypted' => 3, 'encryptedVersion' => 3]);
return $wrapper::wrap($source, $internalPath,
@@ -208,6 +218,7 @@ class EncryptionTest extends \Test\TestCase {
public function testSeek() {
$fileName = tempnam("/tmp", "FOO");
+
$stream = $this->getStream($fileName, 'w+', 0);
$this->assertEquals(6, fwrite($stream, 'foobar'));
$this->assertEquals(0, fseek($stream, 3));