MyBB Community Forums
[Duplicate] MyBB Youtube Video Embedding - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Rejected (https://community.mybb.com/forum-184.html)
+----- Thread: [Duplicate] MyBB Youtube Video Embedding (/thread-216672.html)



MyBB Youtube Video Embedding - Yota_Ninja - 2018-04-01

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="//www.youtube.com/embed/wOMwO5T3yT4" target" frameborder="0" allowfullscreen=""></iframe>

<iframe width="560" height="315" src="//www.youtube.com/embed/wOMwO5T3yT4" target="_blank" rel=&quot;noopener&quot; class=&quot;mycode_url&quot;&gt;https://www.youtube.com/watch#wOMwO5T3yT4&lt;/a&gt;" frameborder="0" allowfullscreen=""></iframe>

PHP Version 7.2.4
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);



RE: MyBB Youtube Video Embedding - .m. - 2018-04-01

please see https://github.com/mybb/mybb/issues/3066
see also https://github.com/mybb/mybb/issues/3085