Project

General

Profile

Actions

Bug #59649

closed

Issue with safari and HTTP_ACCEPT_LANGUAGE with locale 'fr-fr'

Added by Hennebicq Romain over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2014-06-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

We found an issue with the HTTP_ACCEPT_LANGUAGE detection,
when we use safari 7.0.4 with the locale set to 'fr-FR' on osx 10.9.3 the typo3 page are displayed with french and english language (because the default language is french and some pages have no english version).
On the page http://www.univ-paris1.fr/universite/ in the menu the entry "CAMPUS" should be "Implantations" .

So we have created a patch :

class.t3lib_matchcondition_abstract.php
protected function evaluateConditionCommon($key, $value) {
...
case 'language':
$values = t3lib_div::trimExplode(',', $value, TRUE);
foreach ($values as $test) {
if (preg_match('/^\*.+\*$/', $test)) {
$acceptLang = t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE');
$acceptLang = preg_replace('/-[a-z]+/i', '', $acceptLang);
$allLanguages = preg_split('/[,;]/', $acceptLang);
if (in_array(substr($test, 1, -1), $allLanguages)) {
return TRUE;
}
} elseif (t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test) {
return TRUE;
}
}
break;
...

regards,

Romain

Actions

Also available in: Atom PDF