Skip to content

Commit

Permalink
MDL-30042: Sanitize httpwwwroot in mnet jump
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Robert Nicols committed Nov 10, 2011
1 parent 919e659 commit f6d6e54
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auth/mnet/jump.php
Expand Up @@ -37,6 +37,13 @@

// If hostid hasn't been specified, try getting it using wwwroot
if (!$hostid) {
$hostwwwroot = trim($hostwwwroot);
$hostwwwroot = rtrim($hostwwwroot, '/');

// ensure the wwwroot starts with a http or https prefix
if (strtolower(substr($hostwwwroot, 0, 4)) != 'http') {
$hostwwwroot = 'http://'.$hostwwwroot;
}
$hostid = $DB->get_field('mnet_host', 'id', array('wwwroot' => $hostwwwroot));
}

Expand Down

0 comments on commit f6d6e54

Please sign in to comment.