Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed problem when set both loginhttps and https in wwwroot, closes b…

…ug #5507 and #3848; merged from MOODLE_16_STABLE
  • Loading branch information...
commit 2c3432e6842aae32783092def6f6b68512feb9b7 1 parent 91d7ead
skodak authored
View
2  auth/cas/login.php
@@ -18,7 +18,7 @@
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
- $wwwroot = str_replace('http','https',$CFG->wwwroot);
+ $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
$langmenu = popup_form ("$wwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
View
2  lib/moodlelib.php
@@ -1525,7 +1525,7 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
if (empty($CFG->loginhttps)) {
redirect($CFG->wwwroot .'/login/index.php'. $loginguest);
} else {
- $wwwroot = str_replace('http','https', $CFG->wwwroot);
+ $wwwroot = str_replace('http:','https:', $CFG->wwwroot);
redirect($wwwroot .'/login/index.php'. $loginguest);
}
exit;
View
12 lib/weblib.php
@@ -1906,11 +1906,11 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
/// We have to change some URLs in styles if we are in a $HTTPSPAGEREQUIRED page
if (!empty($HTTPSPAGEREQUIRED)) {
- $CFG->themewww = str_replace('http', 'https', $CFG->themewww);
- $CFG->pixpath = str_replace('http', 'https', $CFG->pixpath);
- $CFG->modpixpath = str_replace('http', 'https', $CFG->modpixpath);
+ $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww);
+ $CFG->pixpath = str_replace('http:', 'https:', $CFG->pixpath);
+ $CFG->modpixpath = str_replace('http:', 'https:', $CFG->modpixpath);
foreach ($CFG->stylesheets as $key => $stylesheet) {
- $CFG->stylesheets[$key] = str_replace('http', 'https', $stylesheet);
+ $CFG->stylesheets[$key] = str_replace('http:', 'https:', $stylesheet);
}
}
@@ -1945,7 +1945,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
- $wwwroot = str_replace('http','https',$CFG->wwwroot);
+ $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
if (isset($course->id)) {
$menu = user_login_string($course);
@@ -2430,7 +2430,7 @@ function user_login_string($course=NULL, $user=NULL) {
if (empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
- $wwwroot = str_replace('http','https',$CFG->wwwroot);
+ $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
if (isset($user->id) and $user->id) {
View
2  mod/chat/view.php
@@ -108,7 +108,7 @@
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
notice_yesno(get_string('noguests', 'chat').'<br /><br />'.get_string('liketologin'),
View
2  mod/forum/markposts.php
@@ -29,7 +29,7 @@
if (isguest()) { // Guests can't change forum
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
$strforums = get_string('modulenameplural', 'forum');
View
2  mod/forum/post.php
@@ -16,7 +16,7 @@
if (isguest()) {
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
if (isset($forum)) { // User is starting a new discussion in a forum
View
2  mod/forum/settracking.php
@@ -27,7 +27,7 @@
if (isguest()) { // Guests can't change tracking
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
$strforums = get_string('modulenameplural', 'forum');
View
2  mod/forum/subscribe.php
@@ -43,7 +43,7 @@
if (isguest()) { // Guests can't subscribe
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
$strforums = get_string('modulenameplural', 'forum');
View
2  mod/quiz/view.php
@@ -127,7 +127,7 @@
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
notice_yesno(get_string('guestsno', 'quiz').'<br /><br />'.get_string('liketologin'),
View
2  my/index.php
@@ -14,7 +14,7 @@
if (isguest()) {
$wwwroot = $CFG->wwwroot.'/login/index.php';
if (!empty($CFG->loginhttps)) {
- $wwwroot = str_replace('http','https', $wwwroot);
+ $wwwroot = str_replace('http:','https:', $wwwroot);
}
print_header($mymoodlestr);
View
2  user/tabs.php
@@ -93,7 +93,7 @@
if(empty($CFG->loginhttps)) {
$wwwroot = $CFG->wwwroot;
} else {
- $wwwroot = str_replace('http','https',$CFG->wwwroot);
+ $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
$toprow[] = new tabobject('editprofile', $wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.$course->id, get_string('editmyprofile'));
View
2  user/view.php
@@ -289,7 +289,7 @@
if (empty($CFG->loginhttps)) {
$internalpassword = "$CFG->wwwroot/login/change_password.php";
} else {
- $internalpassword = str_replace('http','https',$CFG->wwwroot.'/login/change_password.php');
+ $internalpassword = str_replace('http:','https:',$CFG->wwwroot.'/login/change_password.php');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.