Skip to content

Conversation

tomwarham
Copy link

If for example you entered a url to be used in an iFrame:

http://example.com/wp-admin/admin-ajax.php?action=h5p_embed&id=148

it would convert the ampersand character to & in the src attribute of the iframe

http://example.com/wp-admin/admin-ajax.php?action=h5p_embed&id=148

I used a basic html entity conversion function to rectify this issue.

I may have also accidentally removed some comments on lines 57 & 58

Hopefully this is of use.

Cheers,
Tomm

@icc
Copy link
Member

icc commented Nov 27, 2015

Are you trying to embed other H5Ps into the iframe-embed content type? If so I'm not sure if that has been tested before :-)

Yes, the validator probably automatically escapes "dangerous" symbols when saving. I think it would be preferable to run them through jQuery, something like this:

var $url = H5P.jQuery('<div/>', {html: options.source});
iFrameSource = $url.text();

It might that it should be run through encodeURI() as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants