Merge pull request #1191 from nextcloud/stable10-share-allowspaceinremote

[stable10] Allow space for federated share id search
This commit is contained in:
Lukas Reschke 2016-08-30 15:37:07 +02:00 committed by GitHub
commit fe3e7629e2
2 changed files with 53 additions and 1 deletions

View File

@ -319,7 +319,7 @@ class Sharees {
$this->result['remotes'] = []; $this->result['remotes'] = [];
} }
if (!$foundRemoteById && substr_count($search, '@') >= 1 && substr_count($search, ' ') === 0 && $this->offset === 0) { if (!$foundRemoteById && substr_count($search, '@') >= 1 && $this->offset === 0) {
$this->result['exact']['remotes'][] = [ $this->result['exact']['remotes'][] = [
'label' => $search, 'label' => $search,
'value' => [ 'value' => [

View File

@ -943,6 +943,58 @@ class ShareesTest extends TestCase {
[], [],
true, true,
], ],
// contact with space
[
'user name@localhost',
[
[
'FN' => 'User3 @ Localhost',
],
[
'FN' => 'User2 @ Localhost',
'CLOUD' => [
],
],
[
'FN' => 'User Name @ Localhost',
'CLOUD' => [
'user name@localhost',
],
],
],
false,
[
['label' => 'User Name @ Localhost', 'value' => ['shareType' => Share::SHARE_TYPE_REMOTE, 'shareWith' => 'user name@localhost', 'server' => 'localhost']],
],
[],
true,
],
// remote with space, no contact
[
'user space@remote',
[
[
'FN' => 'User3 @ Localhost',
],
[
'FN' => 'User2 @ Localhost',
'CLOUD' => [
],
],
[
'FN' => 'User @ Localhost',
'CLOUD' => [
'username@localhost',
],
],
],
false,
[
['label' => 'user space@remote', 'value' => ['shareType' => Share::SHARE_TYPE_REMOTE, 'shareWith' => 'user space@remote']],
],
[],
true,
],
]; ];
} }