Skip to content

Commit

Permalink
If the string is empty, the method does not call providers.
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Apr 26, 2021
1 parent f69a56f commit 2f550a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public function __construct(array $providers)
*/
public function embedMedia(string $html): string
{
if (empty($html)) {
return $html;
}

foreach ($this->providers as $key => $provider) {
if ($provider instanceof EmbedProvider) {
$html = $provider->parse($html);
Expand Down

0 comments on commit 2f550a2

Please sign in to comment.