From f815e4cbdfb665dd281b7c3e180334037250cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Mon, 3 Jun 2013 11:18:02 +0200 Subject: [PATCH] MDL-32480 allow external https links in IMSCP too --- mod/imscp/locallib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/imscp/locallib.php b/mod/imscp/locallib.php index 04640f29ce8..d51ecf7a690 100644 --- a/mod/imscp/locallib.php +++ b/mod/imscp/locallib.php @@ -61,10 +61,9 @@ function imscp_print_content($imscp, $cm, $course) { function imscp_htmllize_item($item, $imscp, $cm) { global $CFG; - if (strpos($item['href'], 'http://') === 0) { + if (preg_match('|^https?://|', $item['href'])) { $url = $item['href']; - } - else { + } else { $context = context_module::instance($cm->id); $urlbase = "$CFG->wwwroot/pluginfile.php"; $path = '/'.$context->id.'/mod_imscp/content/'.$imscp->revision.'/'.$item['href'];