summaryrefslogtreecommitdiff
path: root/check.php
blob: 26da1f3746a465076e5323ab29a64054643ddd9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

/* Hack to prevent function calls with a youtube list. */

if(preg_match("/^(\s|^)(http[s]?:\/\/)?(wwww\.)?(youtu\.be)|(youtube.com)/i", $video)){
	$video = urldecode($video);
	preg_match("/watch\?v=[a-zA-Z0-9-_]{11}/i", $video, $match);
	preg_match("/[a-zA-Z0-9-_]{11}/", $match[0], $id);
	$video = "https://www.youtube.com/watch?v=".$id[0];
}

if(!preg_match("/^http/i", $video)){
	$video = "https://www.youtube.com/watch?v=".$video;
}