Allow space for federated share id search

pull/1189/head
Vincent Petry 9 years ago committed by Lukas Reschke
parent f4dfd1f1a3
commit ec9fd67bc5
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
  1. 2
      apps/files_sharing/lib/Controller/ShareesAPIController.php
  2. 52
      apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php

@ -321,7 +321,7 @@ class ShareesAPIController extends OCSController {
$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'][] = [
'label' => $search,
'value' => [

@ -945,6 +945,58 @@ class ShareesAPIControllerTest extends TestCase {
[],
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,
],
];
}

Loading…
Cancel
Save