Skip to content

Commit

Permalink
Item14348: Fixed _find_mapping returning globs
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Mar 25, 2017
1 parent d1207dc commit 9fa6234
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/Foswiki/Contrib/DatabaseContrib.pm
Expand Up @@ -167,9 +167,11 @@ sub _find_mapping {
if ( $entity =~ /\*/ ) {

my $entityRx = _glob2rx($entity);

# Pattern-match entity.
$found = $user =~ /^$entityRx$/;
if ( $found = $user =~ /^$entityRx$/ ) {
$match = $user;
}

if ( !$found && $entity =~ /Group$/ ) {

Expand All @@ -192,7 +194,10 @@ sub _find_mapping {
GROUP_MATCH:
foreach my $group ( @{ $userGroups->{$user} } ) {
$found = $group =~ /^$entityRx$/;
last GROUP_MATCH if $found;
if ($found) {
$match = $group;
last GROUP_MATCH;
}
}
}
}
Expand Down

0 comments on commit 9fa6234

Please sign in to comment.