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:
@@ -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');"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user