From: skodak Date: Wed, 7 Jan 2009 15:31:54 +0000 (+0000) Subject: MDL-11061 removed wwwroot tests from admin/index.php, now in setuplib.php X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=84b88cfde760fe1726fefba457ce550aea578ac5;p=moodle.git MDL-11061 removed wwwroot tests from admin/index.php, now in setuplib.php --- diff --git a/admin/index.php b/admin/index.php index 1e1dd2adb5..0a0d0b8cb2 100644 --- a/admin/index.php +++ b/admin/index.php @@ -145,13 +145,6 @@ print_box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning'); } - if (substr($CFG->wwwroot, -1) == '/') { - print_box(get_string('cfgwwwrootslashwarning', 'admin'), 'generalbox adminwarning'); - } - if (strpos($FULLME, $CFG->httpswwwroot.'/') === false) { - print_box(get_string('cfgwwwrootwarning', 'admin'), 'generalbox adminwarning'); - } - /// If no recently cron run $lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}'); if (time() - $lastcron > 3600 * 24) { diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 2fae06d5a4..5f21bd2f4c 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -477,6 +477,7 @@ $string['wrongroleid'] = 'Incorrect role ID!'; $string['wrongsourcebase'] = 'Wrong source URL base'; $string['wrongzipfilename'] = 'Wrong ZIP file name'; $string['wwwrootmismatch'] = 'Incorrect access detected, this server may be accessed only through \"$a\" address, sorry.
Please notify server administrator.'; +$string['wwwrootslash'] = 'Detected incorrect \$CFG->wwwroot in config.php, it must not contain trailing slash.
Please notify server administrator.'; $string['xmldberror'] = 'XMLDB error!'; $string['youcannotdeletecategory'] = 'You cannot delete category \'$a\' becuase you can neither delete the contents, nor move them elsewhere.'; diff --git a/lib/setuplib.php b/lib/setuplib.php index 1d8ca93acb..1a344ea7ad 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -91,6 +91,10 @@ function default_exception_handler($ex) { function initialise_fullme() { global $CFG, $FULLME, $ME, $SCRIPT, $FULLSCRIPT; + if (substr($CFG->wwwroot, -1) == '/') { + print_error('wwwrootslash', 'error'); + } + $url = parse_url($CFG->wwwroot); if (!isset($url['path'])) { $url['path'] = '';