Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jul 15, 2024
1 parent 5b43f87 commit ef2c2b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Provider/YouTubeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,11 @@ private function fixBinaryContent(MediaInterface $media): void
return;
}

$isMatching = preg_match(
if (1 === preg_match(
'{^(?:https?://)?(?:www\.)?(?:m\.)?(?:youtu\.be/|youtube\.com/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)/))(?<video_id>[^\#\?&\'>]+)}',
$media->getBinaryContent(),
$matches
);

if (false !== $isMatching) {
)) {
$media->setBinaryContent($matches['video_id']);
}
}
Expand Down

0 comments on commit ef2c2b2

Please sign in to comment.