Skip to content

Commit f7c7884

Browse files
authored
Merge branch 'master' into master
2 parents 5968f4a + 2c27adc commit f7c7884

File tree

8 files changed

+24
-9
lines changed

8 files changed

+24
-9
lines changed

src/Adapters/Adapter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Embed\Http\Url;
1111
use Embed\Providers\Provider;
1212
use Embed\Utils;
13+
use Exception;
1314

1415
/**
1516
* Base class extended by all adapters.
@@ -317,7 +318,11 @@ public function getUrl()
317318
return $this->getFirstFromProviders(function (Provider $provider) use ($blacklist, $homeUrl) {
318319
$url = $provider->getUrl();
319320

320-
if ($homeUrl === $url || (!empty($blacklist) && Url::create($url)->match($blacklist))) {
321+
try {
322+
if ($homeUrl === $url || (!empty($blacklist) && Url::create($url)->match($blacklist))) {
323+
return false;
324+
}
325+
} catch (Exception $error) {
321326
return false;
322327
}
323328

src/Adapters/File.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class File extends Adapter
2828
'image/png' => ['photo', 'imageHtml'],
2929
'image/bmp' => ['photo', 'imageHtml'],
3030
'image/ico' => ['photo', 'imageHtml'],
31+
'image/webp' => ['photo', 'imageHtml'],
3132
'text/rtf' => ['rich', 'google'],
3233
'application/pdf' => ['rich', 'google'],
3334
'application/msword' => ['rich', 'google'],

src/Http/Url.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ private static function getSuffixes()
621621
{
622622
if (self::$public_suffix_list === null) {
623623
self::$public_suffix_list = (@include __DIR__.'/../resources/public_suffix_list.php') ? [];
624-
}
624+
}
625+
625626
return self::$public_suffix_list;
626627
}
627628

src/Providers/OEmbed/Poll.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Embed\Providers\OEmbed;
4+
5+
class Poll extends Polldaddy
6+
{
7+
protected static $pattern = 'poll.fm/*';
8+
}

src/Providers/OEmbed/Polldaddy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
class Polldaddy extends EndPoint implements EndPointInterface
66
{
77
protected static $pattern = 'polldaddy.com/poll/*';
8-
protected static $endPoint = 'http://polldaddy.com/oembed';
8+
protected static $endPoint = 'https://api.crowdsignal.com/oembed';
99
}

tests/CadenaserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function testOne()
1313
'width' => 620,
1414
'height' => 100,
1515
'type' => 'rich',
16-
'code' => '<iframe src="http://play.cadenaser.com/widget/audio/001RD010000004275766/" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:620px;height:100px;"></iframe>',
16+
'code' => '<iframe src="https://play.cadenaser.com/widget/audio/001RD010000004275766/" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:620px;height:100px;"></iframe>',
1717
'providerName' => 'Cadena SER',
1818
]
1919
);

tests/PolldaddyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public function testOne()
1111
[
1212
'title' => 'Which design do you prefer?',
1313
'description' => 'Poll Answers: Option #1, Option #2,',
14-
'code' => '<script type="text/javascript" charset="utf-8" src="https://secure.polldaddy.com/p/7012505.js"></script><noscript><a href="https://polldaddy.com/poll/7012505/">Which design do you prefer?</a></noscript>',
14+
'code' => '<script type="text/javascript" charset="utf-8" src="https://secure.polldaddy.com/p/7012505.js"></script><noscript><a href="https://poll.fm/7012505">Which design do you prefer?</a></noscript>',
1515
'type' => 'rich',
16-
'providerName' => 'Polldaddy',
16+
'providerName' => 'Crowdsignal',
1717
]
1818
);
1919
}

tests/SoundcloudTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function testOne()
1111
[
1212
'title' => "Lost You (feat. Twin Shadow & D'Angelo Lacy) by Zeds Dead",
1313
'type' => 'rich',
14-
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F150745932&show_artwork=true"></iframe>',
14+
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F150745932&show_artwork=true"></iframe>',
1515
'providerName' => 'SoundCloud',
1616
'providerUrl' => 'http://soundcloud.com',
1717
]
@@ -26,7 +26,7 @@ public function testTwo()
2626
'title' => 'Bruce Neil',
2727
'description' => 'Bruce Neil from Wokingham is a singer/songwriter with a folk inspired sound, producing songs with heartfelt depth and lyrics that captivate the listener, taking them on an insightful and thought-provoking journey. As a winner of BBC Introducing, resulting in air play nationally, he has recently achieved widespread public attention following the video release of his percussive folk rendition of Guns N’ Roses track Paradise City. Not only did this go viral on social media, it was endorsed by the band themselves and has achieved recognition and air play from several US radio stations. He takes his musical inspiration and guitar-playing style from the likes of Passenger and Mick Flannery.',
2828
'type' => 'rich',
29-
'code' => '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F6538603&show_artwork=true"></iframe>',
29+
'code' => '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Fusers%2F6538603&show_artwork=true"></iframe>',
3030
'providerName' => 'SoundCloud',
3131
'providerUrl' => 'http://soundcloud.com',
3232
]
@@ -41,7 +41,7 @@ public function testThree()
4141
'title' => 'LOWE CT Cape Times - World Cup by iDidTht.com',
4242
'description' => 'If you did it. Show it on ididtht.com',
4343
'type' => 'rich',
44-
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F191904624&show_artwork=true"></iframe>',
44+
'code' => '<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F191904624&show_artwork=true"></iframe>',
4545
'providerName' => 'SoundCloud',
4646
'providerUrl' => 'http://soundcloud.com',
4747
]

0 commit comments

Comments
 (0)