MDL-63770 core: Fix a false-positive in reverseproxyabused check

A `reverseproxyabused` error is wrongly triggered when external port number doesn't equal internal.
This commit is contained in:
Dmitri Pisarev 2019-01-22 11:09:26 +03:00 committed by Matteo Scaramuccia
parent c357779722
commit 1983718149

View File

@ -899,7 +899,7 @@ function initialise_fullme() {
// hopefully this will stop all those "clever" admins trying to set up moodle
// with two different addresses in intranet and Internet
if (!empty($CFG->reverseproxy) && $rurl['host'] === $wwwroot['host']) {
if (!empty($CFG->reverseproxy) && $rurl['host'] === $wwwroot['host'] && (empty($wwwroot['port']) || $rurl['port'] === $wwwroot['port'])) {
print_error('reverseproxyabused', 'error');
}