Skip to content

Commit

Permalink
Merge pull request #233 from infinum/feature/disable-geolocation-filter
Browse files Browse the repository at this point in the history
Add apply filters to geolocation disabling
  • Loading branch information
volfkarlo authored May 31, 2022
2 parents 18d1fde + 97dc9a1 commit 1706494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Geolocation/Geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function setLocationCookie(): void

// Add the ability to disable geolocation from an external source (generally used for GDPR purposes).
$filterName = Filters::getGeolocationFilterName('disable');
if (\has_filter($filterName)) {
if (\has_filter($filterName) && \apply_filters($filterName, null)) {
return;
}

Expand Down Expand Up @@ -113,7 +113,7 @@ public function isUserGeolocated(string $formId, array $defaultLocations, array

// Add ability to disable geolocation from external source. (Generaly used for GDPR).
$filterName = Filters::getGeolocationFilterName('disable');
if (\has_filter($filterName)) {
if (\has_filter($filterName) && \apply_filters($filterName, null)) {
Helper::logger([
'geolocation' => 'Filter disabled active, skip geolocation.',
'formIdOriginal' => $formId,
Expand Down

0 comments on commit 1706494

Please sign in to comment.