Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-32480 fix display of IMS content packages with external links

  • Loading branch information...
commit f3369f1607f919f3e448f2bdc0a572c8c099447f 1 parent 969e5b5
@ndunand ndunand authored skodak committed
Showing with 9 additions and 4 deletions.
  1. +9 −4 mod/imscp/locallib.php
View
13 mod/imscp/locallib.php
@@ -61,10 +61,15 @@ function imscp_print_content($imscp, $cm, $course) {
function imscp_htmllize_item($item, $imscp, $cm) {
global $CFG;
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
- $urlbase = "$CFG->wwwroot/pluginfile.php";
- $path = '/'.$context->id.'/mod_imscp/content/'.$imscp->revision.'/'.$item['href'];
- $url = file_encode_url($urlbase, $path, false);
+ if (strpos($item['href'], 'http://') === 0) {
+ $url = $item['href'];
+ }
+ else {
+ $context = context_module::instance($cm->id);
+ $urlbase = "$CFG->wwwroot/pluginfile.php";
+ $path = '/'.$context->id.'/mod_imscp/content/'.$imscp->revision.'/'.$item['href'];
+ $url = file_encode_url($urlbase, $path, false);
+ }
$result = "<li><a href=\"$url\">".$item['title'].'</a>';
if ($item['subitems']) {
$result .= '<ul>';
Please sign in to comment.
Something went wrong with that request. Please try again.