Skip to content

Commit

Permalink
add sandbox to iframes for com_resource videos
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-meunier authored and erichhuebner committed May 13, 2021
1 parent 4c23a31 commit b03c4b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/components/com_resources/site/views/view/tmpl/play.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@
}
$url = 'https://www.youtube.com/embed/' . $video_id . '?wmode=transparent';
}
$html .= '<iframe width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" allowfullscreen></iframe>';
$html .= '<iframe sandbox="allow-scripts allow-same-origin" width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" allowfullscreen></iframe>';
}
else if (stristr($parsed['host'], 'vimeo'))
{
$html .= '<iframe width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
$html .= '<iframe sandbox="allow-scripts allow-same-origin" width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
}
else if (stristr($parsed['host'], 'blip'))
{
$html .= '<iframe width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
$html .= '<iframe sandbox="allow-scripts allow-same-origin" width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
}
else
{
$html .= '<iframe width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
$html .= '<iframe sandbox="allow-scripts allow-same-origin" width="' . ($width ? $width : 640) . '" height="' . ($height ? $height : 360) . '" src="' . $url . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
}
}
else if (is_file(PATH_APP . $url))
Expand Down

0 comments on commit b03c4b8

Please sign in to comment.