MDL-85075 files: Use core security helper first

This commit is contained in:
Matthew Hilton
2025-10-23 12:18:49 +10:00
parent d33ecac29c
commit e87bfdef20
+9 -7
View File
@@ -3709,6 +3709,15 @@ class curl {
return null;
}
// Check if the URL is blocked in core curl_security_helper or
// curl security helper that passed to curl class constructor.
// Note, we purposely check the configured helper first,
// as this may be being mocked for unit testing.
if ($this->securityhelper->url_is_blocked($url)) {
$this->error = $this->securityhelper->get_blocked_url_string();
return $this->error;
}
// Augment all installed plugin's security helpers if there is any.
// The plugin's function has to be defined as plugintype_pluginname_curl_security_helper in pluginname/lib.php.
$plugintypes = get_plugins_with_function('curl_security_helper');
@@ -3727,13 +3736,6 @@ class curl {
}
}
// Check if the URL is blocked in core curl_security_helper or
// curl security helper that passed to curl class constructor.
if ($this->securityhelper->url_is_blocked($url)) {
$this->error = $this->securityhelper->get_blocked_url_string();
return $this->error;
}
// Set allowed resolve info if the URL is not blocked.
$this->curlresolveinfo = $this->securityhelper->get_resolve_info();