Merge pull request #9290 from nextcloud/streams-0.6.1

Use better way to determine stream type in stream wrapper
This commit is contained in:
Morris Jobke 2018-05-03 17:15:02 +02:00 committed by GitHub
commit 3f2a5c9335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit d4e8f89af1df2e0b690ce8cae72b63e864472558
Subproject commit d0794726e2c370c80fbcd29d29b2291fdf9e15f8

View File

@ -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);