MyBB Community Forums

Full Version: MyBB Youtube Video Embedding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The returned link is corrupt when using the video tag to embed a YouTube video. This seems to be caused by calling htmlspecialchars_uni on the returned ID.

Examples of corrupt links:
<iframe width="560" height="315" src="//" target" frameborder="0" allowfullscreen=""></iframe>

<iframe width="560" height="315" src="//" target="_blank" rel=&quot;noopener&quot; class=&quot;mycode_url&quot;&gt;;/a&gt;" frameborder="0" allowfullscreen=""></iframe>

PHP Version 7.2.4
[font=Menlo, Consolas, Monaco, monospace]MyBB Version: 1.8.15

Template: video_youtube_embed

File:        /inc/class_parser.php
Function:    mycode_parse_video
Code:        $id = htmlspecialchars_uni($id);

File:        /inc/functions.php
Function:    htmlspecialchars_uni
Code:        $message = str_replace("\"", "&quot;", $message);[/font]