Skip to content

Commit

Permalink
Merge jetpack-helper.php changes from develop
Browse files Browse the repository at this point in the history
See #995, #1002
  • Loading branch information
westonruter committed May 8, 2018
1 parent 145991d commit db95c09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jetpack-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
Expand Down

0 comments on commit db95c09

Please sign in to comment.