Skip to content

Commit

Permalink
Fix all HTTP instances for the Archive.org shortcodes
Browse files Browse the repository at this point in the history
Also update tests accordingly
  • Loading branch information
jeherve committed Aug 23, 2019
1 parent 98b89c3 commit 70bfda5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/shortcodes/archiveorg.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function jetpack_archiveorg_shortcode( $atts ) {
$poster = '';
}

$url = esc_url( set_url_scheme( "https://archive.org/embed/{$id}{$autoplay}{$poster}" ) );
$url = esc_url( "https://archive.org/embed/{$id}{$autoplay}{$poster}" );

$html = "<div class='embed-archiveorg' style='text-align:center;'><iframe src='$url' width='$width' height='$height' style='border:0;' webkitallowfullscreen='true' mozallowfullscreen='true' allowfullscreen></iframe></div>";

Expand Down
6 changes: 3 additions & 3 deletions tests/php/modules/shortcodes/test-class.archiveorg.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function test_shortcode_single_element() {
$id = 'Wonderfu1958';
$content = "[archiveorg id='$id' width='600' height='300']";
$shortcode_content = do_shortcode( $content );
$this->assertContains( "iframe src='http://archive.org/embed/$id' width='600' height='300'", $shortcode_content );
$this->assertContains( "iframe src='https://archive.org/embed/$id' width='600' height='300'", $shortcode_content );
}

/**
Expand All @@ -50,6 +50,6 @@ public function test_shortcode_book() {
$id = 'goodytwoshoes00newyiala';
$content = "[archiveorg-book id='$id' width='600' height='300']";
$shortcode_content = do_shortcode( $content );
$this->assertContains( "iframe src='http://archive.org/stream/$id?ui=embed#mode/1up' width='600' height='300'", $shortcode_content );
$this->assertContains( "iframe src='https://archive.org/stream/$id?ui=embed#mode/1up' width='600' height='300'", $shortcode_content );
}
}
}

0 comments on commit 70bfda5

Please sign in to comment.