Skip to content

Commit

Permalink
Remove parsing of dimensions from HTML as it's not included in the em…
Browse files Browse the repository at this point in the history
…bed response
  • Loading branch information
pierlon authored and westonruter committed Oct 10, 2020
1 parent ee138a8 commit 7a07dac
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions includes/embeds/class-amp-imgur-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ public function filter_embed_oembed_html( $return, $url, $attr ) {
}

if ( false !== strpos( $parsed_url['host'], 'imgur.com' ) ) {
if ( preg_match( '/width=["\']?(\d+)/', $return, $matches ) ) {
$attr['width'] = $matches[1];
}
if ( preg_match( '/height=["\']?(\d+)/', $return, $matches ) ) {
$attr['height'] = $matches[1];
}

if ( empty( $attr['height'] ) ) {
return $return;
}
Expand Down

0 comments on commit 7a07dac

Please sign in to comment.