mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-29 04:20:02 +00:00
Fix i18n.php review comments
* remove useless is_string check * use the DEFAULT_LANGUAGE when Accept-Language is invalid.
This commit is contained in:
parent
780392bb37
commit
20240fee15
1 changed files with 3 additions and 3 deletions
|
|
@ -19,14 +19,14 @@
|
|||
|
||||
// Change language when requested
|
||||
if (isset($_REQUEST['lang'])
|
||||
&& is_string($_REQUEST['lang'])
|
||||
&& in_array($_REQUEST['lang'], array_keys($ALLOWED_LANGUAGES), true)) {
|
||||
$_SESSION['lang'] = $_REQUEST['lang'];
|
||||
}
|
||||
|
||||
// Use the user-specified locale or the browser-specified locale
|
||||
// Use the user-specified locale, or the browser-specified locale, or the app default.
|
||||
$locale = $_SESSION['lang']
|
||||
?: locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
?: locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE'])
|
||||
?: DEFAULT_LANGUAGE;
|
||||
|
||||
/* i18n helper functions */
|
||||
use Symfony\Component\Translation\Loader\PoFileLoader;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue