File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -1788,15 +1788,12 @@ public function shareApiAllowLinks() {
17881788 * @return bool
17891789 */
17901790 public function shareApiLinkEnforcePassword (bool $ checkGroupMembership = true ) {
1791- $ excludedGroups = $ this ->config ->getAppValue ('core ' , 'shareapi_enforce_links_password_excluded_groups ' , '' );
1792- if ($ excludedGroups !== '' && $ checkGroupMembership ) {
1793- $ excludedGroups = json_decode ($ excludedGroups );
1794- $ user = $ this ->userSession ->getUser ();
1795- if ($ user ) {
1796- $ userGroups = $ this ->groupManager ->getUserGroupIds ($ user );
1797- if ((bool )array_intersect ($ excludedGroups , $ userGroups )) {
1798- return false ;
1799- }
1791+ $ user = $ this ->userSession ->getUser ();
1792+ if ($ checkGroupMembership && $ user !== null ) {
1793+ $ userGroups = $ this ->groupManager ->getUserGroupIds ($ user );
1794+ $ excludedGroups = json_decode ($ this ->config ->getAppValue ('core ' , 'shareapi_enforce_links_password_excluded_groups ' , '[] ' ));
1795+ if (count (array_intersect ($ excludedGroups , $ userGroups )) > 0 ) {
1796+ return false ;
18001797 }
18011798 }
18021799 return $ this ->config ->getAppValue ('core ' , 'shareapi_enforce_links_password ' , 'no ' ) === 'yes ' ;
You can’t perform that action at this time.
0 commit comments