From 590706db1f373118fec606082bab27743e89aa2f Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 31 Oct 2017 12:05:06 +0100 Subject: [PATCH] MDL-60634 tool_mobile: Avoid CURL request to check HTTPS --- lib/adminlib.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index 54ea2fd7103..51ab7f0401b 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -8440,16 +8440,11 @@ class admin_setting_enablemobileservice extends admin_setting_configcheckbox { * @return string XHTML */ public function output_html($data, $query='') { - global $CFG, $OUTPUT; + global $OUTPUT; $html = parent::output_html($data, $query); if ((string)$data === $this->yes) { - require_once($CFG->dirroot . "/lib/filelib.php"); - $curl = new curl(); - $httpswwwroot = str_replace('http:', 'https:', $CFG->wwwroot); //force https url - $curl->head($httpswwwroot . "/login/index.php"); - $info = $curl->get_info(); - if (empty($info['http_code']) or ($info['http_code'] >= 400)) { + if (!is_https()) { $html .= $OUTPUT->notification(get_string('nohttpsformobilewarning', 'admin')); } }