Skip to content

Commit

Permalink
Revert "change parse_url() to wp_parse_url()"
Browse files Browse the repository at this point in the history
This reverts commit 90393ea.
  • Loading branch information
Paul Schreiber committed Mar 8, 2017
1 parent 2120a7a commit 0b4c9ff
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion includes/embeds/class-amp-dailymotion-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function render( $args ) {
}

private function get_video_id_from_url( $url ) {
$parsed_url = wp_parse_url( $url );
$parsed_url = parse_url( $url );
parse_str( $parsed_url['path'], $path );
$tok = explode( '/', $parsed_url['path'] );
$tok = explode( '_', $tok[2] );
Expand Down
2 changes: 1 addition & 1 deletion includes/embeds/class-amp-soundcloud-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function render( $args ) {
}

private function get_track_id_from_url( $url ) {
$parsed_url = wp_parse_url( $url );
$parsed_url = parse_url( $url );
$tok = explode( '/', $parsed_url['path'] );
$track_id = $tok[2];

Expand Down
2 changes: 1 addition & 1 deletion includes/embeds/class-amp-youtube-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function render( $args ) {

private function get_video_id_from_url( $url ) {
$video_id = false;
$parsed_url = wp_parse_url( $url );
$parsed_url = parse_url( $url );

if ( self::SHORT_URL_HOST === substr( $parsed_url['host'], -strlen( self::SHORT_URL_HOST ) ) ) {
// youtu.be/{id}
Expand Down
2 changes: 1 addition & 1 deletion includes/sanitizers/class-amp-img-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private function filter_attributes( $attributes ) {

private function is_gif_url( $url ) {
$ext = self::$anim_extension;
$path = wp_parse_url( $url, PHP_URL_PATH );
$path = parse_url( $url, PHP_URL_PATH );
return substr( $path, -strlen( $ext ) ) === $ext;
}
}
2 changes: 1 addition & 1 deletion includes/utils/class-amp-image-dimension-extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function normalize_url( $url ) {
return set_url_scheme( $url, 'http' );
}

$parsed = wp_parse_url( $url );
$parsed = parse_url( $url );
if ( ! isset( $parsed['host'] ) ) {
$path = '';
if ( isset( $parsed['path'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion jetpack-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function jetpack_amp_build_stats_pixel_url() {
$blog = Jetpack_Options::get_option( 'id' );
$tz = get_option( 'gmt_offset' );
$v = 'ext';
$blog_url = wp_parse_url( site_url() );
$blog_url = 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();
Expand Down
4 changes: 2 additions & 2 deletions wpcom-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ function wpcom_amp_extract_image_dimensions_from_querystring( $dimensions ) {
continue;
}

$host = wp_parse_url( $url, PHP_URL_HOST );
$host = parse_url( $url, PHP_URL_HOST );
if ( ! wp_endswith( $host, '.wp.com' ) || ! wp_endswith( $host, '.files.wordpress.com' ) ) {
continue;
}

$query = wp_parse_url( $url, PHP_URL_QUERY );
$query = parse_url( $url, PHP_URL_QUERY );
$w = isset( $query['w'] ) ? absint( $query['w'] ) : false;
$h = isset( $query['h'] ) ? absint( $query['h'] ) : false;

Expand Down

0 comments on commit 0b4c9ff

Please sign in to comment.