2 Commits

Author SHA1 Message Date
Nathan Nguyen
3f1cfcb908 WR#310007 - Fix failed unit test 2019-04-23 13:21:44 +10:00
Brendan Heywood
dec4c7bf53 Fixed ipwhitelist escaping issue #150 2019-03-28 14:32:20 +11:00
2 changed files with 2 additions and 2 deletions

View File

@@ -246,7 +246,7 @@ class outagelib {
}
// I know Moodle validation would clean up this field, but just in case, let's ensure no
// single-quotes (and double for the sake of it) are present otherwise it would break the code.
$allowedips = str_replace('\'"', '', $allowedips);
$allowedips = addslashes($allowedips);
$code = <<<'EOT'
<?php

View File

@@ -289,7 +289,7 @@ class outagelib_test extends advanced_testcase {
if ((time() >= 123) && (time() < 456)) {
define('MOODLE_INTERNAL', true);
require_once($CFG->dirroot.'/lib/moodlelib.php');
if (!remoteip_in_list('heyyou
if (!remoteip_in_list('hey\'\"you
a.b.c.d
e.e.e.e/20')) {
header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance');