Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30042: Sanitize httpwwwroot in mnet jump

  • Loading branch information...
commit 5720c0b1ffc1416d711e38621ed01360bb260e46 1 parent f08f22c
@andrewnicols andrewnicols authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 auth/mnet/jump.php
View
7 auth/mnet/jump.php
@@ -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));
}
Please sign in to comment.
Something went wrong with that request. Please try again.