diff options
author | Robin Appelman <robin@icewind.nl> | 2018-04-24 11:34:08 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-01 15:06:21 +0200 |
commit | 57ba18f47f18886f3ea31df5eca399e83609e4b6 (patch) | |
tree | c7054d221cd28d0d0d1e4990fa01e2ec93c58a2f /lib | |
parent | c27016b1d15f85d1860b45d5bf9564316d9cf23a (diff) | |
download | nextcloud-server-57ba18f47f18886f3ea31df5eca399e83609e4b6.tar.gz nextcloud-server-57ba18f47f18886f3ea31df5eca399e83609e4b6.zip |
Use better way to determine stream type in encryption stream wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Stream/Encryption.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php index 05be5a5b286..65d379c0289 100644 --- a/lib/private/Files/Stream/Encryption.php +++ b/lib/private/Files/Stream/Encryption.php @@ -195,10 +195,10 @@ class Encryption extends Wrapper { protected static function wrapSource($source, $context, $protocol, $class, $mode = 'r+') { try { stream_wrapper_register($protocol, $class); - if (@rewinddir($source) === false) { - $wrapped = fopen($protocol . '://', $mode, false, $context); - } else { + if (self::isDirectoryHandle($source)) { $wrapped = opendir($protocol . '://', $context); + } else { + $wrapped = fopen($protocol . '://', $mode, false, $context); } } catch (\BadMethodCallException $e) { stream_wrapper_unregister($protocol); |