Skip to content
Snippets Groups Projects
Unverified Commit 3f2a5c93 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #9290 from nextcloud/streams-0.6.1

 Use better way to determine stream type in stream wrapper
parents 2d66f04a 57ba18f4
No related branches found
No related tags found
No related merge requests found
Subproject commit d4e8f89af1df2e0b690ce8cae72b63e864472558 Subproject commit d0794726e2c370c80fbcd29d29b2291fdf9e15f8
...@@ -195,10 +195,10 @@ class Encryption extends Wrapper { ...@@ -195,10 +195,10 @@ class Encryption extends Wrapper {
protected static function wrapSource($source, $context, $protocol, $class, $mode = 'r+') { protected static function wrapSource($source, $context, $protocol, $class, $mode = 'r+') {
try { try {
stream_wrapper_register($protocol, $class); stream_wrapper_register($protocol, $class);
if (@rewinddir($source) === false) { if (self::isDirectoryHandle($source)) {
$wrapped = fopen($protocol . '://', $mode, false, $context);
} else {
$wrapped = opendir($protocol . '://', $context); $wrapped = opendir($protocol . '://', $context);
} else {
$wrapped = fopen($protocol . '://', $mode, false, $context);
} }
} catch (\BadMethodCallException $e) { } catch (\BadMethodCallException $e) {
stream_wrapper_unregister($protocol); stream_wrapper_unregister($protocol);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment