summaryrefslogtreecommitdiff
path: root/check.php
diff options
context:
space:
mode:
Diffstat (limited to 'check.php')
-rw-r--r--check.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/check.php b/check.php
new file mode 100644
index 0000000..26da1f3
--- /dev/null
+++ b/check.php
@@ -0,0 +1,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;
+}