summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-08 10:11:22 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-08 10:11:22 +0100
commitca32778975323e743f0a0c7c548d44e283eb6813 (patch)
tree8bb1a7a442d867b86da27bf89604ba047bc66753 /apps
parent4130639a7ede41e7178eb4ce1d4ba328a697f722 (diff)
downloadnextcloud-server-ca32778975323e743f0a0c7c548d44e283eb6813.tar.gz
nextcloud-server-ca32778975323e743f0a0c7c548d44e283eb6813.zip
Even single shares are returned as array
When fetching a single share using ../shares/<ID> we should still return an array of shares. Fixes #22189
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/api/share20ocs.php2
-rw-r--r--apps/files_sharing/tests/api/share20ocstest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index d7c5d004d9c..c03243d1d41 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -170,7 +170,7 @@ class Share20OCS {
if ($this->canAccessShare($share)) {
$share = $this->formatShare($share);
- return new \OC_OCS_Result($share);
+ return new \OC_OCS_Result([$share]);
} else {
return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
}
diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/api/share20ocstest.php
index a93cd5f58ce..97abdca7ac3 100644
--- a/apps/files_sharing/tests/api/share20ocstest.php
+++ b/apps/files_sharing/tests/api/share20ocstest.php
@@ -387,7 +387,7 @@ class Share20OCSTest extends \Test\TestCase {
['group', $group],
]));
- $expected = new \OC_OCS_Result($result);
+ $expected = new \OC_OCS_Result([$result]);
$this->assertEquals($expected->getData(), $ocs->getShare($share->getId())->getData());
}