diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index efb8d3b..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,12 +0,0 @@ -# .github/workflows/ci.yml -name: ci - -on: [push, pull_request] - -jobs: - ci: - uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main - secrets: - moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }} - with: - disable_behat: true diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index 7e42885..7312681 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -56,7 +56,7 @@ class outagelib { global $CFG; require_once($CFG->libdir . '/filelib.php'); - $curl = new curl(['ignoresecurity' => true]); + $curl = new curl(); $contents = $curl->get($file); $info = $curl->get_info(); if (!empty($info['content_type'])) { diff --git a/tests/controllers_maintenance_static_page_test.php b/tests/controllers_maintenance_static_page_test.php index 858d83d..9c3fccf 100644 --- a/tests/controllers_maintenance_static_page_test.php +++ b/tests/controllers_maintenance_static_page_test.php @@ -429,39 +429,6 @@ final class controllers_maintenance_static_page_test extends base_testcase { maintenance_static_page_io::file_get_data(200); } - /** - * Test file_get_data with curlsecurityblockedhosts. - * We will use an external URL to test passing ignoresecurity inside of file_get_data works, - * ideally in real code we should only be calling file_get_data with internal URLs. - */ - public function test_file_get_data_curlsecurityblockedhosts(): void { - global $CFG, $USER; - - $testhtml = $this->getExternalTestFileUrl('/test.html'); - $url = new \moodle_url($testhtml); - $host = $url->get_host(); - set_config('curlsecurityblockedhosts', $host); // Blocks $host. - - // Test a regular curl with the default security enabled does in fact get blocked. - $curl = new \curl(); - $contents = $curl->get($testhtml); - $expected = $curl->get_security()->get_blocked_url_string(); - self::assertSame($expected, $contents); - self::assertSame(0, $curl->get_errno()); - if ($CFG->branch >= 403) { - self::assertDebuggingCalled( - "Blocked $testhtml: The URL is blocked. [user {$USER->id}]", - DEBUG_NONE - ); - } - - // Test file_get_data does return the page and isn't blocked by security. - $found = maintenance_static_page_io::file_get_data($url->out()); - $expected = '47250a973d1b88d9445f94db4ef2c97a'; - self::assertSame($expected, md5($found['contents'])); - self::assertSame('text/html', $found['mime']); - } - /** * Test remove css selector. */