1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 23:56:41 +02:00

Add problematic basenaem/locale detection and warning per issue processwire/processwire-issues#157

This commit is contained in:
Ryan Cramer
2017-02-06 06:38:59 -05:00
parent 310ea9d281
commit ceae45cda7

View File

@@ -270,7 +270,6 @@ class ProcessLogin extends Process {
/**
* Hook called after login
*
* @todo: move the following elsewhere out of this class:
* Notify admin if there are any issues that need their attention.
* Happens only on the admin login form after superuser login.
*
@@ -336,6 +335,17 @@ class ProcessLogin extends Process {
$this->error("Warning: you have a field named 'published' that conflicts with the page 'published' property. Please rename your field field to something else and update any templates referencing it.");
}
// warning about servers with locales that break UTF-8 strings called by basename
// and other file functions, due to a long running PHP bug
if(basename("§") === "") {
$s = stripos(PHP_OS, 'WIN') === 0 ? 'en-US' : 'en_US.UTF-8';
$this->warning(
$this->_('Warning: your server locale is undefined and may cause issues.') . ' ' .
sprintf($this->_('Please add this to /site/config.php file (adjust “%s” as needed):'), $s) . ' ' .
"setlocale(LC_ALL,'$s');"
);
}
}
/**