Skip to content

Commit

Permalink
Merge pull request #28 from wrav/release/1.2.1
Browse files Browse the repository at this point in the history
Re-add `rel` feature missing due to merge conflict
  • Loading branch information
reganlawton authored Jan 19, 2020
2 parents 7b9a8ca + 5a42d4e commit 554032a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# oEmbed Changelog

## 1.2.1 - 2020-01-19

### Updated
- Re-add `rel` feature missing due to merge conflict. ([#24](https://github.com/wrav/oembed/issues/24))

## 1.2.0 - 2020-01-19

### Updated
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": "1.2.0",
"version": "1.2.1",
"keywords": [
"craft",
"cms",
Expand Down
5 changes: 5 additions & 0 deletions src/services/OembedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public function __call(string $name , array $arguments )
$src = preg_replace('/\?(.*)$/i', '?autopause='. (!!$options['autopause'] ? '1' : '0') .'&${1}', $src);
}

// Rel
if (!empty($options['rel']) && strpos($html, 'rel=') === false && $src) {
$src = preg_replace('/\?(.*)$/i', '?rel='. (!!$options['rel'] ? '1' : '0') .'&${1}', $src);
}

$iframe->setAttribute('src', $src);
$media->code = $dom->saveXML($iframe);
} catch (\Exception $exception) {
Expand Down

0 comments on commit 554032a

Please sign in to comment.