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+') {
|
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);
|
||||||
|
|
Loading…
Reference in New Issue