Bug #59649
closedIssue with safari and HTTP_ACCEPT_LANGUAGE with locale 'fr-fr'
0%
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