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 7, 2011
1 parent 735de1c commit 2a420f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auth/mnet/jump.php
Original file line number Diff line number Diff line change
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 2a420f5

Please sign in to comment.