Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/apbct-public-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_ext-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_ext-protection_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_full-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_full-protection_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_int-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_int-protection_gathering.min.js

Large diffs are not rendered by default.

25 changes: 17 additions & 8 deletions js/prebuild/apbct-public-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3077,10 +3077,8 @@ class ApbctHandler {
* @return {void}
*/
detectForcedAltCookiesForms() {
let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0;
let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0;
ctPublic.force_alt_cookies = smartFormsSign ||
jetpackCommentsForm;
ctPublic.force_alt_cookies = jetpackCommentsForm;

setTimeout(function() {
if (!ctPublic.force_alt_cookies) {
Expand Down Expand Up @@ -3111,7 +3109,8 @@ class ApbctHandler {
typeof cwginstock !== 'undefined'
) ||
document.querySelector('div.fluent_booking_wrap') !== null || // Fluent Booking Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null // Fluent Booking / Calendar Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null || // Fluent Booking / Calendar Pro
document.querySelectorAll('script[id*="smart-forms"]').length > 0
) {
const originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(body) {
Expand All @@ -3121,13 +3120,16 @@ class ApbctHandler {
body.indexOf('action=booked_add_appt') !== -1 ||
body.indexOf('action=cwginstock_product_subscribe') !== -1 ||
body.indexOf('action=et_pb_submit_subscribe_form') !== -1 ||
body.indexOf('rednao_smart_forms_save_form_values') !== -1 ||
(
body.indexOf('action=mailpoet') !== -1 &&
body.indexOf('method=subscribe') !== -1
)
);
const isDiviNewsletterRequest = body && typeof body === 'string' &&
body.indexOf('action=et_pb_submit_subscribe_form') !== -1;
const isSmartFormsRequest = body && typeof body === 'string' &&
body.indexOf('rednao_smart_forms_save_form_values') !== -1;

let isNeedToAddCleantalkDataCheckFormData = body && typeof body === 'object' &&
body instanceof FormData &&
Expand All @@ -3137,10 +3139,11 @@ class ApbctHandler {

if (isNeedToAddCleantalkDataCheckString) {
let addidionalCleantalkData = '';
const noCookieDataKey = isDiviNewsletterRequest ?
const useUnwrappedCleantalkKeys = isDiviNewsletterRequest || isSmartFormsRequest;
const noCookieDataKey = useUnwrappedCleantalkKeys ?
'ct_no_cookie_hidden_field' :
'data%5Bct_no_cookie_hidden_field%5D';
const eventTokenKey = isDiviNewsletterRequest ?
const eventTokenKey = useUnwrappedCleantalkKeys ?
'ct_bot_detector_event_token' :
'data%5Bct_bot_detector_event_token%5D';

Expand All @@ -3149,13 +3152,19 @@ class ApbctHandler {
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
if (body.indexOf('ct_no_cookie_hidden_field=') === -1) {
const hasNoCookieField =
body.indexOf('ct_no_cookie_hidden_field=') !== -1 ||
body.indexOf('data%5Bct_no_cookie_hidden_field%5D=') !== -1;
if (!hasNoCookieField) {
addidionalCleantalkData += '&' + noCookieDataKey + '=' + noCookieData;
}
} else {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
if (body.indexOf('ct_bot_detector_event_token=') === -1) {
const hasEventToken =
body.indexOf('ct_bot_detector_event_token=') !== -1 ||
body.indexOf('data%5Bct_bot_detector_event_token%5D=') !== -1;
if (!hasEventToken) {
addidionalCleantalkData += '&' + eventTokenKey + '=' + eventToken;
}
}
Expand Down
25 changes: 17 additions & 8 deletions js/prebuild/apbct-public-bundle_ext-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3077,10 +3077,8 @@ class ApbctHandler {
* @return {void}
*/
detectForcedAltCookiesForms() {
let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0;
let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0;
ctPublic.force_alt_cookies = smartFormsSign ||
jetpackCommentsForm;
ctPublic.force_alt_cookies = jetpackCommentsForm;

setTimeout(function() {
if (!ctPublic.force_alt_cookies) {
Expand Down Expand Up @@ -3111,7 +3109,8 @@ class ApbctHandler {
typeof cwginstock !== 'undefined'
) ||
document.querySelector('div.fluent_booking_wrap') !== null || // Fluent Booking Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null // Fluent Booking / Calendar Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null || // Fluent Booking / Calendar Pro
document.querySelectorAll('script[id*="smart-forms"]').length > 0
) {
const originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(body) {
Expand All @@ -3121,13 +3120,16 @@ class ApbctHandler {
body.indexOf('action=booked_add_appt') !== -1 ||
body.indexOf('action=cwginstock_product_subscribe') !== -1 ||
body.indexOf('action=et_pb_submit_subscribe_form') !== -1 ||
body.indexOf('rednao_smart_forms_save_form_values') !== -1 ||
(
body.indexOf('action=mailpoet') !== -1 &&
body.indexOf('method=subscribe') !== -1
)
);
const isDiviNewsletterRequest = body && typeof body === 'string' &&
body.indexOf('action=et_pb_submit_subscribe_form') !== -1;
const isSmartFormsRequest = body && typeof body === 'string' &&
body.indexOf('rednao_smart_forms_save_form_values') !== -1;

let isNeedToAddCleantalkDataCheckFormData = body && typeof body === 'object' &&
body instanceof FormData &&
Expand All @@ -3137,10 +3139,11 @@ class ApbctHandler {

if (isNeedToAddCleantalkDataCheckString) {
let addidionalCleantalkData = '';
const noCookieDataKey = isDiviNewsletterRequest ?
const useUnwrappedCleantalkKeys = isDiviNewsletterRequest || isSmartFormsRequest;
const noCookieDataKey = useUnwrappedCleantalkKeys ?
'ct_no_cookie_hidden_field' :
'data%5Bct_no_cookie_hidden_field%5D';
const eventTokenKey = isDiviNewsletterRequest ?
const eventTokenKey = useUnwrappedCleantalkKeys ?
'ct_bot_detector_event_token' :
'data%5Bct_bot_detector_event_token%5D';

Expand All @@ -3149,13 +3152,19 @@ class ApbctHandler {
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
if (body.indexOf('ct_no_cookie_hidden_field=') === -1) {
const hasNoCookieField =
body.indexOf('ct_no_cookie_hidden_field=') !== -1 ||
body.indexOf('data%5Bct_no_cookie_hidden_field%5D=') !== -1;
if (!hasNoCookieField) {
addidionalCleantalkData += '&' + noCookieDataKey + '=' + noCookieData;
}
} else {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
if (body.indexOf('ct_bot_detector_event_token=') === -1) {
const hasEventToken =
body.indexOf('ct_bot_detector_event_token=') !== -1 ||
body.indexOf('data%5Bct_bot_detector_event_token%5D=') !== -1;
if (!hasEventToken) {
addidionalCleantalkData += '&' + eventTokenKey + '=' + eventToken;
}
}
Expand Down
25 changes: 17 additions & 8 deletions js/prebuild/apbct-public-bundle_ext-protection_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3077,10 +3077,8 @@ class ApbctHandler {
* @return {void}
*/
detectForcedAltCookiesForms() {
let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0;
let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0;
ctPublic.force_alt_cookies = smartFormsSign ||
jetpackCommentsForm;
ctPublic.force_alt_cookies = jetpackCommentsForm;

setTimeout(function() {
if (!ctPublic.force_alt_cookies) {
Expand Down Expand Up @@ -3111,7 +3109,8 @@ class ApbctHandler {
typeof cwginstock !== 'undefined'
) ||
document.querySelector('div.fluent_booking_wrap') !== null || // Fluent Booking Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null // Fluent Booking / Calendar Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null || // Fluent Booking / Calendar Pro
document.querySelectorAll('script[id*="smart-forms"]').length > 0
) {
const originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(body) {
Expand All @@ -3121,13 +3120,16 @@ class ApbctHandler {
body.indexOf('action=booked_add_appt') !== -1 ||
body.indexOf('action=cwginstock_product_subscribe') !== -1 ||
body.indexOf('action=et_pb_submit_subscribe_form') !== -1 ||
body.indexOf('rednao_smart_forms_save_form_values') !== -1 ||
(
body.indexOf('action=mailpoet') !== -1 &&
body.indexOf('method=subscribe') !== -1
)
);
const isDiviNewsletterRequest = body && typeof body === 'string' &&
body.indexOf('action=et_pb_submit_subscribe_form') !== -1;
const isSmartFormsRequest = body && typeof body === 'string' &&
body.indexOf('rednao_smart_forms_save_form_values') !== -1;

let isNeedToAddCleantalkDataCheckFormData = body && typeof body === 'object' &&
body instanceof FormData &&
Expand All @@ -3137,10 +3139,11 @@ class ApbctHandler {

if (isNeedToAddCleantalkDataCheckString) {
let addidionalCleantalkData = '';
const noCookieDataKey = isDiviNewsletterRequest ?
const useUnwrappedCleantalkKeys = isDiviNewsletterRequest || isSmartFormsRequest;
const noCookieDataKey = useUnwrappedCleantalkKeys ?
'ct_no_cookie_hidden_field' :
'data%5Bct_no_cookie_hidden_field%5D';
const eventTokenKey = isDiviNewsletterRequest ?
const eventTokenKey = useUnwrappedCleantalkKeys ?
'ct_bot_detector_event_token' :
'data%5Bct_bot_detector_event_token%5D';

Expand All @@ -3149,13 +3152,19 @@ class ApbctHandler {
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
if (body.indexOf('ct_no_cookie_hidden_field=') === -1) {
const hasNoCookieField =
body.indexOf('ct_no_cookie_hidden_field=') !== -1 ||
body.indexOf('data%5Bct_no_cookie_hidden_field%5D=') !== -1;
if (!hasNoCookieField) {
addidionalCleantalkData += '&' + noCookieDataKey + '=' + noCookieData;
}
} else {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
if (body.indexOf('ct_bot_detector_event_token=') === -1) {
const hasEventToken =
body.indexOf('ct_bot_detector_event_token=') !== -1 ||
body.indexOf('data%5Bct_bot_detector_event_token%5D=') !== -1;
if (!hasEventToken) {
addidionalCleantalkData += '&' + eventTokenKey + '=' + eventToken;
}
}
Expand Down
25 changes: 17 additions & 8 deletions js/prebuild/apbct-public-bundle_full-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3077,10 +3077,8 @@ class ApbctHandler {
* @return {void}
*/
detectForcedAltCookiesForms() {
let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0;
let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0;
ctPublic.force_alt_cookies = smartFormsSign ||
jetpackCommentsForm;
ctPublic.force_alt_cookies = jetpackCommentsForm;

setTimeout(function() {
if (!ctPublic.force_alt_cookies) {
Expand Down Expand Up @@ -3111,7 +3109,8 @@ class ApbctHandler {
typeof cwginstock !== 'undefined'
) ||
document.querySelector('div.fluent_booking_wrap') !== null || // Fluent Booking Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null // Fluent Booking / Calendar Pro
document.querySelector('div.fcal_calendar_slot_wrap ') !== null || // Fluent Booking / Calendar Pro
document.querySelectorAll('script[id*="smart-forms"]').length > 0
) {
const originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(body) {
Expand All @@ -3121,13 +3120,16 @@ class ApbctHandler {
body.indexOf('action=booked_add_appt') !== -1 ||
body.indexOf('action=cwginstock_product_subscribe') !== -1 ||
body.indexOf('action=et_pb_submit_subscribe_form') !== -1 ||
body.indexOf('rednao_smart_forms_save_form_values') !== -1 ||
(
body.indexOf('action=mailpoet') !== -1 &&
body.indexOf('method=subscribe') !== -1
)
);
const isDiviNewsletterRequest = body && typeof body === 'string' &&
body.indexOf('action=et_pb_submit_subscribe_form') !== -1;
const isSmartFormsRequest = body && typeof body === 'string' &&
body.indexOf('rednao_smart_forms_save_form_values') !== -1;

let isNeedToAddCleantalkDataCheckFormData = body && typeof body === 'object' &&
body instanceof FormData &&
Expand All @@ -3137,10 +3139,11 @@ class ApbctHandler {

if (isNeedToAddCleantalkDataCheckString) {
let addidionalCleantalkData = '';
const noCookieDataKey = isDiviNewsletterRequest ?
const useUnwrappedCleantalkKeys = isDiviNewsletterRequest || isSmartFormsRequest;
const noCookieDataKey = useUnwrappedCleantalkKeys ?
'ct_no_cookie_hidden_field' :
'data%5Bct_no_cookie_hidden_field%5D';
const eventTokenKey = isDiviNewsletterRequest ?
const eventTokenKey = useUnwrappedCleantalkKeys ?
'ct_bot_detector_event_token' :
'data%5Bct_bot_detector_event_token%5D';

Expand All @@ -3149,13 +3152,19 @@ class ApbctHandler {
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
if (body.indexOf('ct_no_cookie_hidden_field=') === -1) {
const hasNoCookieField =
body.indexOf('ct_no_cookie_hidden_field=') !== -1 ||
body.indexOf('data%5Bct_no_cookie_hidden_field%5D=') !== -1;
if (!hasNoCookieField) {
addidionalCleantalkData += '&' + noCookieDataKey + '=' + noCookieData;
}
} else {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
if (body.indexOf('ct_bot_detector_event_token=') === -1) {
const hasEventToken =
body.indexOf('ct_bot_detector_event_token=') !== -1 ||
body.indexOf('data%5Bct_bot_detector_event_token%5D=') !== -1;
if (!hasEventToken) {
addidionalCleantalkData += '&' + eventTokenKey + '=' + eventToken;
}
}
Expand Down
Loading
Loading