Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38419: External tool - when force SSL checked, URLs get corrupted

  • Loading branch information...
commit 0ed5fa3b882633739b6561eafa38397794c85fe7 1 parent 43fed59
@mrmark mrmark authored danpoltawski committed
Showing with 7 additions and 1 deletion.
  1. +1 −1  mod/lti/locallib.php
  2. +6 −0 mod/lti/tests/locallib_test.php
View
2  mod/lti/locallib.php
@@ -1168,7 +1168,7 @@ function lti_ensure_url_is_https($url) {
} else {
//If the URL starts with http, replace with https
if (stripos($url, 'http://') === 0) {
- $url = 'https://' . substr($url, 8);
+ $url = 'https://' . substr($url, 7);
}
}
View
6 mod/lti/tests/locallib_test.php
@@ -139,4 +139,10 @@ public function disabled_test_parse_grade_replace_message() {
lti_verify_sourcedid($ltiinstance, $parsed);
}
+
+ public function test_lti_ensure_url_is_https() {
+ $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('http://moodle.org'));
+ $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('moodle.org'));
+ $this->assertEquals('https://moodle.org', lti_ensure_url_is_https('https://moodle.org'));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.