Fixed import of youtube bbcodes (WBB3)
authorMarcel Werk <burntime@woltlab.com>
Fri, 21 Dec 2018 17:08:44 +0000 (18:08 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 21 Dec 2018 17:08:44 +0000 (18:08 +0100)
Closes #34

files/lib/system/exporter/WBB3xExporter.class.php

index 4b06e3f535d7850809da8026f1d455fc03f1430a..c6c859e7c7acbf29029f1380809b06ad35011fe9 100644 (file)
@@ -2733,6 +2733,7 @@ class WBB3xExporter extends AbstractExporter {
                $message = preg_replace('~\[/(?:php|java|css|html|xml|tpl|js|c|mysql)\]~', '[/code]', $message);
                
                // media bbcodes
+               $message = preg_replace('~\[youtube\]([a-z0-9_-]+)\[/youtube\]~i', '[media]https://www.youtube.com/watch?v=\\1[/media]', $message);
                $message = preg_replace("~\[(?:youtube|myvideo|myspace|googlevideo|clipfish|sevenload)(?:='?([^'\],]+)'?)?(?:,[^\]]+)?\]~", '[media]\\1', $message);
                $message = preg_replace('~\[/(?:youtube|myvideo|myspace|googlevideo|clipfish|sevenload)\]~', '[/media]', $message);