summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Files/Stream/Encryption.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php
index 05be5a5b286..65d379c0289 100644
--- a/lib/private/Files/Stream/Encryption.php
+++ b/lib/private/Files/Stream/Encryption.php
@@ -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);