fix(php): use filter_var for proper boolean casting in config

This commit is contained in:
FrankZamora
2025-12-10 16:04:35 -06:00
parent a2c4f857be
commit 449e2e1740

View File

@@ -497,10 +497,10 @@ function roi_enqueue_adsense_loader() {
$lazy_fill_timeout = roi_get_component_setting('adsense-placement', 'behavior', 'lazy_fill_timeout', '5000');
$config = array(
'lazyEnabled' => (bool) $lazy_enabled,
'lazyEnabled' => filter_var($lazy_enabled, FILTER_VALIDATE_BOOLEAN),
'rootMargin' => (int) $lazy_rootmargin . 'px 0px',
'fillTimeout' => (int) $lazy_fill_timeout,
'debug' => defined('WP_DEBUG') && WP_DEBUG,
'debug' => defined('WP_DEBUG') && WP_DEBUG ? true : false,
);
wp_add_inline_script(