Security and privacy

HTTP to HTTPS converter for external content

 
 
Picture of Tomasz Muras
Re: HTTP to HTTPS converter for external content
Group DevelopersGroup Particularly helpful MoodlersGroup Plugins guardiansGroup Translators
Hello,

At Enovation we have created a script for changing hardcoded urls in the Moodle database. Our approach is a bit different than the options above. We edit records directly in the database but we use whitelist for columns and tables. This is basically to make sure we know exactly what we edit. This alone could leave some content unchanged, so in the next step script does a search for hardcoded URLs across the whole database this time with blacklist. When records are found you can add them to wishlist and replace or decide to ignore them and add to search blacklist.

When changing this kind of data you also need to consider base64 encoded and url-encoded data and handle it appropriately. You want base64 search to be efficient - that is work using database query and not have to decode each record.

Finally our script works as a CLI but it's not Moodle admin tool - we wanted it to work even with old 1.9 Moodles.

We would be happy to share it publicly on github if you're interested. You can obviously use it to change url like http://example.com into https://example.com.

Cheers,
Tomek
 
Average of ratings:Useful (1)
Picture of John Okely
Re: HTTP to HTTPS converter for external content
Group DevelopersGroup Moodle HQGroup Testers

Sounds like a good solution. It would be great to see that code, thanks!

 
Average of ratings: -
Picture of Tomasz Muras
Re: HTTP to HTTPS converter for external content
Group DevelopersGroup Particularly helpful MoodlersGroup Plugins guardiansGroup Translators
Our script is here: https://github.com/enovation/moodle-url_change . If you decide to do Moodle admin tool for 2.8 it may be worth moving some code into a shared library to share the code - as we will definitely want to use it across all Moodle versions.


cheers
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: HTTP to HTTPS converter for external content
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

How does your proposed tool differ from tool_replace in standard Moodle? Wouldn't it be better to improve that tool than to build a separate add-on?

 
Average of ratings: -