aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornodiscc <nodiscc@gmail.com>2015-04-10 20:30:15 +0200
committernodiscc <nodiscc@gmail.com>2015-04-10 20:30:15 +0200
commit507849290c802b2a2a45541d6888108a9aef238b (patch)
tree597f4c1929f0165f1489488d99dc1e2c907bbc98
parentc5db827aee741315cf4789ed63074d6229fe7fba (diff)
parentda49603b86966ea9b915174c629b6329a2502473 (diff)
downloadShaarli-507849290c802b2a2a45541d6888108a9aef238b.tar.gz
Shaarli-507849290c802b2a2a45541d6888108a9aef238b.tar.zst
Shaarli-507849290c802b2a2a45541d6888108a9aef238b.zip
Merge remote-tracking branch 'ArthurHoaro/localecharset' into next
-rw-r--r--index.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/index.php b/index.php
index b622f963..69a53c56 100644
--- a/index.php
+++ b/index.php
@@ -307,9 +307,10 @@ function autoLocale()
307 { // (It's a bit crude, but it works very well. Preferred language is always presented first.) 307 { // (It's a bit crude, but it works very well. Preferred language is always presented first.)
308 if (preg_match('/([a-z]{2})-?([a-z]{2})?/i',$_SERVER['HTTP_ACCEPT_LANGUAGE'],$matches)) { 308 if (preg_match('/([a-z]{2})-?([a-z]{2})?/i',$_SERVER['HTTP_ACCEPT_LANGUAGE'],$matches)) {
309 $loc = $matches[1] . (!empty($matches[2]) ? '_' . strtoupper($matches[2]) : ''); 309 $loc = $matches[1] . (!empty($matches[2]) ? '_' . strtoupper($matches[2]) : '');
310 $attempts = array($loc, str_replace('_', '-', $loc), 310 $attempts = array($loc.'.UTF-8', $loc, str_replace('_', '-', $loc).'.UTF-8', str_replace('_', '-', $loc),
311 $loc . '_' . strtoupper($loc), $loc . '_' . $loc, 311 $loc . '_' . strtoupper($loc).'.UTF-8', $loc . '_' . strtoupper($loc),
312 $loc . '-' . strtoupper($loc), $loc . '-' . $loc); 312 $loc . '_' . $loc.'.UTF-8', $loc . '_' . $loc, $loc . '-' . strtoupper($loc).'.UTF-8',
313 $loc . '-' . strtoupper($loc), $loc . '-' . $loc.'.UTF-8', $loc . '-' . $loc);
313 } 314 }
314 } 315 }
315 setlocale(LC_TIME, $attempts); // LC_TIME = Set local for date/time format only. 316 setlocale(LC_TIME, $attempts); // LC_TIME = Set local for date/time format only.