]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow space for federated share id search 1191/head
authorVincent Petry <pvince81@owncloud.com>
Mon, 29 Aug 2016 09:52:44 +0000 (11:52 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Tue, 30 Aug 2016 10:57:23 +0000 (12:57 +0200)
apps/files_sharing/lib/API/Sharees.php
apps/files_sharing/tests/API/ShareesTest.php

index a7eb13708f3bd8748bb942f58df21b84fe0985a0..efa3ce6ff569a654aaa5a015a8c29e2ad813ccb8 100644 (file)
@@ -319,7 +319,7 @@ class Sharees {
                        $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' => [
index 041b45216afcf4861ef170edb0fcce8b2f567a12..d20fd49260bcac950e6cfb42c369109eec527e5b 100644 (file)
@@ -943,6 +943,58 @@ class ShareesTest 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,
+                       ],
                ];
        }