Browse Source

Check Accept-Language existence before use

pull/13/head
Miraty 10 months ago
parent
commit
70fe23d053
  1. 2
      inc.php

2
inc.php

@ -11,7 +11,7 @@ define("DEFAULT_MAINCOLOR", "000000");
$libreqrVersion = "1.3.0";
// Defines the locale to be used
if ($forceLocale == false) {
if ($forceLocale == false AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$clientLocales = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$clientLocales = preg_replace("#[A-Z0-9]|q=|;|-|\.#", "", $clientLocales);
$clientLocales = explode(',', $clientLocales);

Loading…
Cancel
Save