mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Use better way to determine stream type in encryption stream wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
c27016b1d1
commit
57ba18f47f
1 changed files with 3 additions and 3 deletions
|
|
@ -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 a new issue