Ampersands can’t be used in JavaScript fields
-
Hi,
I was putting some JavaScript into the “On accept callback function” field but it wouldn’t run because
&&had been converted to&&.Here is a git diff that fixes that bug:
diff --git a/admin/partials/v8/ccc-cookiecontrol-settings-defaults.php b/admin/partials/v8/ccc-cookiecontrol-settings-defaults.php index 8670e25..d3eff05 100644 --- a/admin/partials/v8/ccc-cookiecontrol-settings-defaults.php +++ b/admin/partials/v8/ccc-cookiecontrol-settings-defaults.php @@ -594,7 +594,7 @@ class CCC_Cookie_Control_Admin_Dependencies_v8{ ?> cookies: [ <?php echo wp_kses( stripslashes( $string_name ), $allowedHTML ); ?> ], onAccept: function () { - <?php echo wp_kses( stripslashes( $ccc_cookiecontrol_settings['optionalCookiesonAccept'][ $key ] ), $allowedHTML ); ?> + <?php echo stripslashes( $ccc_cookiecontrol_settings['optionalCookiesonAccept'][ $key ] ); ?> }, onRevoke: function () { <?php echo wp_kses( stripslashes( $ccc_cookiecontrol_settings['optionalCookiesonRevoke'][ $key ] ), $allowedHTML ); ?> @@ -628,4 +628,4 @@ class CCC_Cookie_Control_Admin_Dependencies_v8{ } } -?> \ No newline at end of file +?>Note that wp_kses() is also used for the
onRevokefunction so that probably suffers from the same problem.Thank you,
Mallory Adams
https://www.dxw.com/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Ampersands can’t be used in JavaScript fields’ is closed to new replies.