diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index 0c23cfc..ba400ae 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -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' '1']; outagelib::reinject(); - self::assertCount(2, phpunit_util::get_debugging_messages()); + self::assertCount(0, phpunit_util::get_debugging_messages()); phpunit_util::reset_debugging(); } @@ -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');