Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where urls were showing encoded html entities #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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