summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/streams/src/Path.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-01-19 14:38:03 +0100
committerRobin Appelman <robin@icewind.nl>2017-01-19 14:39:40 +0100
commitd5728b3f117ff3b7ab45a4672f4999f7225b875b (patch)
tree04a229475228a6f33cb3c97075f6994d6b07380d /apps/files_external/3rdparty/icewind/streams/src/Path.php
parent2cfedb3623f532e22b007680c2978be1542600af (diff)
downloadnextcloud-server-d5728b3f117ff3b7ab45a4672f4999f7225b875b.tar.gz
nextcloud-server-d5728b3f117ff3b7ab45a4672f4999f7225b875b.zip
update icewind/streams to 0.5.2
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/3rdparty/icewind/streams/src/Path.php')
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/Path.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_external/3rdparty/icewind/streams/src/Path.php b/apps/files_external/3rdparty/icewind/streams/src/Path.php
index 46d2156b69a..bef9fd5f616 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/Path.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/Path.php
@@ -56,7 +56,7 @@ class Path {
protected function register() {
if (!$this->registered) {
- $this->appendDefaultContent($this->getProtocol(), $this->contextOptions);
+ $this->appendDefaultContent($this->contextOptions);
stream_wrapper_register($this->getProtocol(), $this->class);
$this->registered = true;
}
@@ -71,13 +71,17 @@ class Path {
/**
* Add values to the default stream context
*
- * @param string $key
* @param array $values
*/
- protected function appendDefaultContent($key, $values) {
+ protected function appendDefaultContent($values) {
+ if (!is_array(current($values))) {
+ $values = array($this->getProtocol() => $values);
+ }
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
- $defaults[$key] = $values;
+ foreach ($values as $key => $value) {
+ $defaults[$key] = $value;
+ }
stream_context_set_default($defaults);
}