Skip to content

Commit

Permalink
Merge pull request #9290 from nextcloud/streams-0.6.1
Browse files Browse the repository at this point in the history
 Use better way to determine stream type in stream wrapper
  • Loading branch information
MorrisJobke authored May 3, 2018
2 parents 2d66f04 + 57ba18f commit 3f2a5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/private/Files/Stream/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ public static function wrap($source, $internalPath, $fullPath, array $header,
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);
Expand Down

0 comments on commit 3f2a5c9

Please sign in to comment.