Skip to content
Snippets Groups Projects

Count facets to check limit instead of probing offset

Merged Adam Vessey requested to merge issue/facet_bot_blocker-3529390:3529390-count-items into 1.0.x
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -149,7 +149,7 @@ class FacetBotBlockerEventSubscriber implements EventSubscriberInterface {
@@ -149,7 +149,7 @@ class FacetBotBlockerEventSubscriber implements EventSubscriberInterface {
// Check if the request is "over the limit" => blocked.
// Check if the request is "over the limit" => blocked.
$request = $requestEvent->getRequest();
$request = $requestEvent->getRequest();
$is_blocked = FALSE;
$is_blocked = FALSE;
if (isset($_GET['f'][$limit])) {
if (isset($_GET['f']) && is_array($_GET['f']) && count($_GET['f']) > $limit) {
$is_blocked = TRUE;
$is_blocked = TRUE;
}
}
Loading