diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-05-03 17:15:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 17:15:02 +0200 |
commit | 3f2a5c9335a0a96858edb65785eec149b16f1a0e (patch) | |
tree | bb5a0efea2201bea776f0500e81249f8e57167e2 /lib | |
parent | 2d66f04aa01ac1667724ed35777e165602e7506e (diff) | |
parent | 57ba18f47f18886f3ea31df5eca399e83609e4b6 (diff) | |
download | nextcloud-server-3f2a5c9335a0a96858edb65785eec149b16f1a0e.tar.gz nextcloud-server-3f2a5c9335a0a96858edb65785eec149b16f1a0e.zip |
Merge pull request #9290 from nextcloud/streams-0.6.1
Use better way to determine stream type in stream wrapper
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); |