H5P Iframe Embedder URL with space results in 404

Hello,

I have detected a problem with H5P Iframe Embedder working on Moodle. If I set a URL to a PDF that has a space in the filename and I store it in a moodle folder, H5P gives an error and does not show the content, resulting in 404 Not Found.

Steps to replicate it:

 

 

In DevTools, if you analyze the URL that is being used to embed, you can find that it is encoding the %20 part of the URL as %2520. I think it encodes the original % itself as %25, resulting in %2520 and this is finally not recognized correctly and 404 is returned.

Actually, I detected the problem using the Interactive Book activity and in this one using Iframe Embedder, but in the end the problem seems to be in the latter.

This happens in Moodle 3.9.15, 3.11.8 and also in 4.0.4.

Greetings and thanks

Summary: 
H5P Iframe Embedder URL with space results in 404. URL space enconding issue?
Content types: 
otacke's picture

Hi!

The iframe embedder in fact encodes the URI that is provided. Just enter the URL with a space instead of %20 and you should be good to go.

Best,
Oliver

Hi Oliver,

thanks, we also noticed what you said.

We have to take into account that the teacher normally does not write the URL by hand, he copies it from another site and that URL should be correct, it has the spaces encoded and does not require modification. 

In this case, so that the teacher did not have to edit the URL, what we suggested was to remove the spaces in the filename of the uploaded file in moodle and then copy the URL, however, it is still something "weird" that the teacher must do it this way.

Actually, I was just trying to report it in case it was feasible for the H5P component to stop altering the URL in this way, with the intention that the user would only have to copy and paste a URL without paying attention to character encoding issues.

Regards

otacke's picture

Hi jmabreu!

I am merely a community member who mentioned a potential workaround. Handling this still falls into the hands of the H5P core team that I am not a part of.

Cheers,
Oliver

BV52's picture

Hi All,

I don't think the development team will fix this "issue" since development for this content type has stopped a few years back. In reality we do not recommned using Iframe embedder due to accessibility, unresponsiveness, security and privacy concerns.

-BV

Hi,

ok, thank you for your time, we will take it into account.

Regards