Skip to content

Commit 227f563

Browse files
committed
fix referrer issue #716
1 parent 068c689 commit 227f563

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

inc/filters.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public static function should_do_page( $contains_flags, $match_flags ) {
2626
}
2727

2828
$check_against = [ $_SERVER['REQUEST_URI'] ];
29-
if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
29+
// This logic is implemented to target ajax requests withing excluded pages.
30+
// The ajax request will have the referer set to the page url and is using a POST request.
31+
// If is using a GET request, this can be targeted with the availabile excluding rules.
32+
if ( isset( $_SERVER['HTTP_REFERER'] ) && $_SERVER['REQUEST_METHOD'] === 'POST' ) {
3033
$check_against[] = $_SERVER['HTTP_REFERER'];
3134
}
3235
foreach ( $check_against as $check ) {

0 commit comments

Comments
 (0)