From 9172d5f8979dcf58e448af014a624b4a334c95be Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Fri, 5 Aug 2022 10:27:22 +0200 Subject: [PATCH] fix(ga): cookie parsing --- includes/oauth/class-google-services-connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/oauth/class-google-services-connection.php b/includes/oauth/class-google-services-connection.php index cba3cefa87..ae922be647 100644 --- a/includes/oauth/class-google-services-connection.php +++ b/includes/oauth/class-google-services-connection.php @@ -98,8 +98,8 @@ public static function send_custom_event( $event_spec ) { if ( isset( $event_spec['cid'] ) ) { $analytics_ping_params['cid'] = $event_spec['cid']; } elseif ( isset( $_COOKIE['_ga'] ) ) { - list($version, $domain_depth, $cid1, $cid2) = explode( '.', $_COOKIE['_ga'], 4 ); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $analytics_ping_params['cid'] = $cid1 . '.' . $cid2; + list($version, $domain_depth, $cid) = explode( '.', $_COOKIE['_ga'], 3 ); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $analytics_ping_params['cid'] = $cid; } else { $analytics_ping_params['cid'] = '555'; // Anonymous client. }