diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e97f4f4b932..4d0e1d6589b 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8432,6 +8432,12 @@ function cleardoubleslashes ($path) { function remoteip_in_list($list){ $inlist = false; $client_ip = getremoteaddr(); + + if(!$client_ip){ + // ensure access on cli + return true; + } + $list = explode("\n", $list); foreach($list as $subnet) { $subnet = trim($subnet);