Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix for FallbackAdapter not being handled correctly #119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# oEmbed Changelog

## 2.2.1 - 2022-06-30

### Update
- Fix a side effect of #101 fix where the preview and embed will fallback to the default Craft site if no or invalid URL is provided (@juban)

## 2.2.0 - 2022-06-30

### Update
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wrav/oembed",
"description": "A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.",
"type": "craft-plugin",
"version": "2.2.0",
"version": "2.2.1",
"keywords": [
"craft",
"cms",
Expand Down
4 changes: 2 additions & 2 deletions src/services/OembedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public function embed($url, array $options = [])
try {
$dom = new DOMDocument;
$code = $media->getCode();
if (empty($code)) {
$code = Utils::iframe($media->url);
if (empty($code) && !($media instanceof FallbackAdapter)) {
$code = empty((string)$url) ? '' : Utils::iframe($media->url);
}
$dom->loadHTML($code);

Expand Down