]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correction for 'Fix group detection for sharing in case username contains '@', fix...
authorMichael Gapczynski <mtgap@owncloud.com>
Sat, 28 Jul 2012 15:06:36 +0000 (11:06 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 30 Jul 2012 14:07:20 +0000 (10:07 -0400)
apps/files_sharing/lib_share.php

index b939132a9a0f0ccbb3ed0298b45138d7b2b4985b..29a69360d39b17a2116470b6886f3f2a43f1445a 100644 (file)
@@ -182,10 +182,13 @@ class OC_Share {
                                $uid_shared_with = OC_Group::usersInGroup($uid_shared_with);
                                // Remove the owner from the list of users in the group
                                $uid_shared_with = array_diff($uid_shared_with, array(OCP\USER::getUser()));
-                       } else if ($uid = strrchr($uid_shared_with, '@', true)) {
-                               $uid_shared_with = array($uid);
                        } else {
-                               $uid_shared_with = array($uid_shared_with);
+                               $pos = strrpos($uid_shared_with, '@');
+                               if ($pos !== false && OC_Group::groupExists(substr($uid_shared_with, $pos + 1))) {
+                                       $uid_shared_with = array(substr($uid_shared_with, 0, $pos));
+                               } else {
+                                       $uid_shared_with = array($uid_shared_with);
+                               }
                        }
                        foreach ($uid_shared_with as $uid) {
                                $sharedFolder = $uid.'/files/Shared';