Skip to content

Commit b566bae

Browse files
bramleysuelaP
authored andcommitted
Set $pageroot to empty string when it has been entered as '/' to avoid the warning about it being incorrect.
Improve the warning message by including the values that do not match.
1 parent 34b3741 commit b566bae

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

public_html/lists/admin/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,11 @@ function mb_strtolower($string)
712712

713713
if (WARN_ABOUT_PHP_SETTINGS && !$GLOBALS['commandline']) {
714714
if (strpos(getenv('REQUEST_URI'), $pageroot.'/admin') !== 0) {
715-
Warn($GLOBALS['I18N']->get('The pageroot in your config does not match the current locationCheck your config file.'));
715+
Warn(s(
716+
'The pageroot in your config "%s" does not match the current location "%s". Check your config file.',
717+
$pageroot,
718+
strstr(getenv('REQUEST_URI'), '/admin', true)
719+
));
716720
}
717721
}
718722
clearstatcache();

public_html/lists/admin/init.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,15 @@
687687
$attachment_repository = $tmpdir;
688688
}
689689

690-
if (!isset($pageroot)) {
690+
if (isset($pageroot)) {
691+
if ($pageroot == '/') {
692+
$pageroot = '';
693+
}
694+
} else {
691695
$pageroot = '/lists';
692-
$GLOBALS['pageroot'] = '/lists';
693696
}
694-
//# as the "admin" in adminpages is hardcoded, don't put it in the config file
697+
// as the "admin" in adminpages is hardcoded, don't put it in the config file
695698
$adminpages = $GLOBALS['pageroot'].'/admin';
696-
//# remove possibly duplicated // at the beginning
697-
$adminpages = preg_replace('~^//~', '/', $adminpages);
698699

699700
$GLOBALS['homepage'] = 'home';
700701

0 commit comments

Comments
 (0)