From db95c09b265bc7b8eb11814af95deec784b66c04 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 7 May 2018 18:06:41 -0700 Subject: [PATCH] Merge jetpack-helper.php changes from develop See #995, #1002 --- jetpack-helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jetpack-helper.php b/jetpack-helper.php index 03ce4e49353..7fc8102587f 100644 --- a/jetpack-helper.php +++ b/jetpack-helper.php @@ -78,16 +78,16 @@ function jetpack_amp_build_stats_pixel_url() { $blog = Jetpack_Options::get_option( 'id' ); $tz = get_option( 'gmt_offset' ); $v = 'ext'; - $blog_url = AMP_WP_Utils::parse_url( site_url() ); + $blog_url = wp_parse_url( site_url() ); $srv = $blog_url['host']; $j = sprintf( '%s:%s', JETPACK__API_VERSION, JETPACK__VERSION ); $post = $wp_the_query->get_queried_object_id(); $data = compact( 'v', 'j', 'blog', 'post', 'tz', 'srv' ); } - $data['host'] = isset( $_SERVER['HTTP_HOST'] ) ? rawurlencode( $_SERVER['HTTP_HOST'] ) : ''; // input var ok. - $data['rand'] = 'RANDOM'; // amp placeholder. - $data['ref'] = 'DOCUMENT_REFERRER'; // amp placeholder. + $data['host'] = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // input var ok. + $data['rand'] = 'RANDOM'; // AMP placeholder. + $data['ref'] = 'DOCUMENT_REFERRER'; // AMP placeholder. $data = array_map( 'rawurlencode', $data ); return add_query_arg( $data, 'https://pixel.wp.com/g.gif' ); }