mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Set sandbox permissions for redditgifts-embed iframe
This commit is contained in:
@@ -1059,13 +1059,24 @@ class PromoteApiController(ApiController):
|
||||
form.set_error(errors.BAD_URL, "gifts_embed_url")
|
||||
return
|
||||
|
||||
sandbox = (
|
||||
'allow-popups',
|
||||
'allow-forms',
|
||||
'allow-same-origin',
|
||||
'allow-scripts',
|
||||
)
|
||||
iframe_attributes = {
|
||||
'embed_url': websafe(iframe_embed_url),
|
||||
'sandbox': ' '.join(sandbox),
|
||||
}
|
||||
iframe = """
|
||||
<iframe class="redditgifts-embed"
|
||||
src="%(embed_url)s"
|
||||
width="710" height="500" scrolling="no"
|
||||
frameborder="0" allowfullscreen>
|
||||
frameborder="0" allowfullscreen
|
||||
sandbox="%(sandbox)s">
|
||||
</iframe>
|
||||
""" % {'embed_url': websafe(gifts_embed_url)}
|
||||
""" % iframe_attributes
|
||||
media_object = {
|
||||
'oembed': {
|
||||
'description': 'redditgifts embed',
|
||||
|
||||
Reference in New Issue
Block a user