From b4870c4f3e44bbb522d94d37c282e87a451dc1bf Mon Sep 17 00:00:00 2001 From: Yohann Date: Fri, 20 Dec 2019 12:53:28 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20de=20l'affichage=20de=20vid=C3=A9o?= =?UTF-8?q?s=20Youtube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_files/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_files/model.php b/server_files/model.php index f89fcf6..263dcc8 100644 --- a/server_files/model.php +++ b/server_files/model.php @@ -298,8 +298,8 @@ function exportProblemsData() { function displayVideo($link) { - if (preg_match("#(https?://|)(www\.|)youtube\.com/watch\?v=(.*)#", $link, $matches)) { - $code = $matches[3]; + if (preg_match("#(https?://|)(www\.|)(youtube\.com/watch\?v=|youtu.be/)(.*)#", $link, $matches)) { + $code = $matches[4]; /** @noinspection HtmlDeprecatedAttribute */ /** @noinspection HtmlDeprecatedTag */ echo "

\n";