Open fifthsegment opened 6 years ago
Also, to get the embeds to work, I had to add the following:
3- h5p/h5p-php-library/h5p.classes.php::getAssetsUrls() (Line # 2065)
After that line I added the following code: $url = str_replace('//', '/', $url);
Could you check your WP_HOME
and WP_SITEURL
variables on the /wp-admin/options-general.php
page or in the wp-config.php
file?
It sounds like one of these URLs may be ending with an extra slash.
Though, it would probably be good if the code could handle such cases.
I was unable to load the editor at all. When I checked the console; it seemed like the editor was constantly trying to load it's resources again and again but had the incorrect url :
http://wp-content/xxxx
. When I viewed source of my editor page, I realized the H5PIntegration object had an incorrect URL; all resource URL's were starting with a double slash instead of a single slash.I think the regex used for doing preg_replace for generating URLs fails to generate a correct URL on Azure IIS based setups.
FIX: After spending a lot of time going through the source code, I finally found a simple fix (2 files):
FYI, I'm using version : 1.10.0.
1- h5p/admin/class-h5p-content-admin.php::add_editor_assets(). (Line # 945) After that line I added the following code:
$url = str_replace('//', '/', $url);
2- h5p/public/class-h5p-plugin.php::add_core_assets(). (Line # 1114) After that line I added the following code:
$rel_path = str_replace("//", "/", $rel_path );
Could you guys, please test out my fix and add it to the source code if it doesn't break anything else?
Thanks!