mirror of
https://github.com/moodle/moodle.git
synced 2025-03-17 14:10:08 +01:00
MDL-57274 upgrade: fix curl security notices during upgrade/install
Handles the case where $CFG->curlsecurityxxx vars don't yet exist during install or upgrade by treating not set the same as empty.
This commit is contained in:
parent
9ec952f237
commit
a448a38b1d
@ -235,6 +235,9 @@ class curl_security_helper extends curl_security_helper_base {
|
||||
*/
|
||||
protected function get_whitelisted_ports() {
|
||||
global $CFG;
|
||||
if (!isset($CFG->curlsecurityallowedport)) {
|
||||
return [];
|
||||
}
|
||||
return array_filter(explode("\n", $CFG->curlsecurityallowedport), function($entry) {
|
||||
return !empty($entry);
|
||||
});
|
||||
@ -247,6 +250,9 @@ class curl_security_helper extends curl_security_helper_base {
|
||||
*/
|
||||
protected function get_blacklisted_hosts() {
|
||||
global $CFG;
|
||||
if (!isset($CFG->curlsecurityblockedhosts)) {
|
||||
return [];
|
||||
}
|
||||
return array_filter(array_map('trim', explode("\n", $CFG->curlsecurityblockedhosts)), function($entry) {
|
||||
return !empty($entry);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user