Skip to content

Commit 6387545

Browse files
committed
Fixed issue with empty maxwidth oembed param
1 parent d57f30e commit 6387545

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ToolMate Changelog
22

3+
## 1.0.1 - 2020-12-14
4+
### Fixed
5+
- Fixed issue with empty maxwidth oembed param
6+
37
## 1.0.0 - 2020-05-09
48

59
### Added

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vaersaagod/toolmate",
33
"description": "Is that a tool in your pocket, or are you just happy to see me, mate?",
44
"type": "craft-plugin",
5-
"version": "1.0.0",
5+
"version": "1.0.1",
66
"keywords": [
77
"craft",
88
"cms",
@@ -28,8 +28,8 @@
2828
],
2929
"require": {
3030
"craftcms/cms": "^3.1.0",
31-
"matthiasmullie/minify": "^1.3.0",
32-
"voku/html-min": "^4.4.0"
31+
"matthiasmullie/minify": "^1.3.0",
32+
"voku/html-min": "^4.4.0"
3333
},
3434
"autoload": {
3535
"psr-4": {

src/services/EmbedService.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ public function getVideoEmbed(string $videoUrl, array $params = []): array
7575
// set the semi-ubiquitous parameters
7676
$maxWidth = isset($params['max_width']) ? '&maxwidth=' . $params['max_width'] : '';
7777
$maxHeight = isset($params['max_height']) ? '&maxheight=' . $params['max_height'] : '';
78-
if (empty($maxHeight)) // correct for a bug in YouTube response if only maxheight is set and the video is over 612px wide
79-
{
80-
$maxHeight = '&maxheight=' . $maxWidth;
81-
}
8278
$wmode_param = isset($params['wmode']) ? '&wmode=' . $params['wmode'] : '';
8379
$url .= $maxWidth . $maxHeight . $wmode_param;
8480

0 commit comments

Comments
 (0)