Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
replace parse_url() with wp_parse_url()
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Schreiber committed Mar 8, 2018
1 parent 65b88f7 commit 944bbf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/embeds/class-amp-vimeo-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function render( $args ) {
// Takes the last component of a Vimeo URL
// and returns it as the associated video id
private function get_video_id_from_url( $url ) {
$parsed_url = parse_url( $url );
$parsed_url = wp_parse_url( $url );
parse_str( $parsed_url['path'], $path );

$video_id = "";
Expand Down
4 changes: 2 additions & 2 deletions wpcom-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ function wpcom_amp_extract_image_dimensions_from_querystring( $dimensions ) {
continue;
}

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

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

Expand Down

0 comments on commit 944bbf9

Please sign in to comment.