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:
commit
3f2a5c9335
2
3rdparty
2
3rdparty
|
@ -1 +1 @@
|
|||
Subproject commit d4e8f89af1df2e0b690ce8cae72b63e864472558
|
||||
Subproject commit d0794726e2c370c80fbcd29d29b2291fdf9e15f8
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue