mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-55587 core_media: Properly escape ampersand
This commit is contained in:
parent
35d5053ba2
commit
0f826e9f36
@ -105,7 +105,7 @@ class filter_mediaplugin_testcase extends advanced_testcase {
|
||||
$paddedurl = str_pad($originalurl, 6000, 'z');
|
||||
$validpaddedurl = '<p>Some text.</p><pre style="color: rgb(0, 0, 0); line-height: normal;"><span class="mediaplugin mediaplugin_youtube">
|
||||
<iframe title="Valid link" width="400" height="300"
|
||||
src="https://www.youtube.com/embed/uUhWl9Lm3OM?rel=0&wmode=transparent" frameborder="0" allowfullscreen="1"></iframe>
|
||||
src="https://www.youtube.com/embed/uUhWl9Lm3OM?rel=0&wmode=transparent" frameborder="0" allowfullscreen="1"></iframe>
|
||||
</span></pre><pre style="color: rgb(0, 0, 0); line-height: normal;">';
|
||||
$validpaddedurl = str_pad($validpaddedurl, 6000 + (strlen($validpaddedurl) - strlen($originalurl)), 'z');
|
||||
|
||||
|
@ -540,20 +540,20 @@ class core_media_player_youtube extends core_media_player_external {
|
||||
$params = '';
|
||||
$start = self::get_start_time($url);
|
||||
if ($start > 0) {
|
||||
$params .= "start=$start&";
|
||||
$params .= "start=$start&";
|
||||
}
|
||||
|
||||
$listid = $url->param('list');
|
||||
// Check for non-empty but valid playlist ID.
|
||||
if (!empty($listid) && !preg_match('/[^a-zA-Z0-9\-_]/', $listid)) {
|
||||
// This video is part of a playlist, and we want to embed it as such.
|
||||
$params .= "list=$listid&";
|
||||
$params .= "list=$listid&";
|
||||
}
|
||||
|
||||
return <<<OET
|
||||
<span class="mediaplugin mediaplugin_youtube">
|
||||
<iframe title="$info" width="$width" height="$height"
|
||||
src="https://www.youtube.com/embed/$videoid?{$params}rel=0&wmode=transparent" frameborder="0" allowfullscreen="1"></iframe>
|
||||
src="https://www.youtube.com/embed/$videoid?{$params}rel=0&wmode=transparent" frameborder="0" allowfullscreen="1"></iframe>
|
||||
</span>
|
||||
OET;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user