catalyst / moodle-auth_outage

Planned, graduated user and admin friendly moodle outages
https://moodle.org/plugins/auth_outage
17 stars 34 forks source link

Outage fails to load SVG when building static page #194

Closed golenkovm closed 4 years ago

golenkovm commented 4 years ago

SVG support has been added to Moodle as part of https://tracker.moodle.org/browse/MDL-22955 If $CFG->svgicons is not set in config.php, a decision to enable SVG support or not is made based on user's browser: https://github.com/moodle/moodle/blob/1d4fdb0d1c60448104bc9eac79b5123863c67cbd/lib/classes/useragent.php#L966-L990

where $instance->useragent is defined here: https://github.com/moodle/moodle/blob/1d4fdb0d1c60448104bc9eac79b5123863c67cbd/lib/classes/useragent.php#L132-L133

If your Moodle instance has a theme with SVG logo, outage will fail to build a static page, because the main curl request doesn't set CURLOPT_USERAGENT option, therefor useragent is set to false and SVG can't be loaded:

https://github.com/catalyst/moodle-auth_outage/blob/master/classes/local/outagelib.php#L60-L71

golenkovm commented 4 years ago

This is fixed by #195