Skip to content

Commit

Permalink
further update check_if_profilefield_applies() to have a correct resp…
Browse files Browse the repository at this point in the history
…onse (#719)
  • Loading branch information
semteacher committed Dec 5, 2024
1 parent 4458aa5 commit 8301763
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions classes/booking_campaigns/campaigns_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,20 +449,23 @@ public static function check_if_profilefield_applies(
}
switch ($operator) {
case "=": // Equals.
$blocking = $user->profile[$fieldname] === $field;
if ($blocking = $user->profile[$fieldname] === $field) {
return true;
}
break;
case "~": // Contains.
$blocking = strpos($user->profile[$fieldname], $field) !== false;
if ($blocking = strpos($user->profile[$fieldname], $field) !== false) {
return true;
}
break;
case "!~":
// Does not contain.
$blocking = strpos($user->profile[$fieldname], $field) == false;
if (!$blocking = strpos($user->profile[$fieldname], $field) === false) {
return false;
}
break;
}
$result = $blocking;
if ($result == true) {
break;
}
}
return $result;
}
Expand Down

0 comments on commit 8301763

Please sign in to comment.