Fix URL is blocked message when not behind a proxy/load balancer

When there is no proxy/load balancer and curlsecurityblockedhosts is set to
default (i.e. has 127.0.0.1 in it) fetching the outage page will result in
a "The URL is blocked." message. This resolves that issue by passing
ignoresecurity to the curl object.
This commit is contained in:
Rossco Hellmans
2025-02-10 12:35:44 +10:00
parent 11fbe64c46
commit 51db933862
2 changed files with 32 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ class outagelib {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$curl = new curl();
$curl = new curl(['ignoresecurity' => true]);
$contents = $curl->get($file);
$info = $curl->get_info();
if (!empty($info['content_type'])) {