From e399f9ab3311823fe8563d82c582768977f9bbd3 Mon Sep 17 00:00:00 2001 From: Yohann Date: Sun, 22 Dec 2019 17:24:14 +0100 Subject: [PATCH] Prise en charge de Google Drive --- server_files/model.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server_files/model.php b/server_files/model.php index 263dcc8..bdcab22 100644 --- a/server_files/model.php +++ b/server_files/model.php @@ -300,9 +300,15 @@ function displayVideo($link) { if (preg_match("#(https?://|)(www\.|)(youtube\.com/watch\?v=|youtu.be/)(.*)#", $link, $matches)) { $code = $matches[4]; - /** @noinspection HtmlDeprecatedAttribute */ - /** @noinspection HtmlDeprecatedTag */ - echo "

\n"; + /** @noinspection HtmlDeprecatedAttribute */ + /** @noinspection HtmlDeprecatedTag */ + echo "

\n"; + } + elseif (preg_match("#(https?://|)drive\.google\.com/file/d/(.*)/.*?#", $link, $matches)) { + $code = $matches[2]; + /** @noinspection HtmlDeprecatedAttribute */ + /** @noinspection HtmlDeprecatedTag */ + echo "

\n"; } elseif (preg_match("#(https?://|)(www\.|)vimeo\.com/([0-9]*)#", $link, $matches)) { $code = $matches[3];