Commit dec559cf authored by guschilds's avatar guschilds

Issue #1865284 by Vensdale: Fixed warning thrown when getting video_id from an empty value

parent 6890eb53
......@@ -17,9 +17,9 @@
function youtube_get_video_id($input) {
// See README.txt for accepted URL formats.
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $input, $matches);
$video_id = $matches[1];
if (!empty($video_id)) {
if (!empty($matches[1])) {
$video_id = $matches[1];
return $video_id;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment