CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#9042] Wrong parsing of HTTP_ACCEPT_LANGUAGE

avatar
Created By: Martin Malý (natrim)
Date Submitted: Tue Mar 12 04:29:09 -0400 2013

Assigned To:
Version: 1.11.2.1
CMSMS Version: None
Severity: Trivial
Resolution: Fixed
State: Closed
Summary:
Wrong parsing of HTTP_ACCEPT_LANGUAGE
Detailed Description:
The parsing of HTTP_ACCEPT_LANGUAGE in get_browser_languages fails in IE.

IE sends something like: cs-CZ
which the regexp fails to parse right
(FIrefox sends it with _ ( cs_CZ ) so it goes ok)

fixed for now by adding alias to /lib/nls/cs_CZ.nls.php
$nls['alias']['cs-CS'] = 'cs_CZ' ;
$nls['alias']['cs-CZ'] = 'cs_CZ' ;


History

Comments
avatar
Date: 2013-03-12 04:43
Posted By: Martin Malý (natrim)

EDIT: removing the - break it in opera with
cs,en;q=0.9,en-US;q=0.8,ja;q=0.7,fr;q=0.6,de;q=0.5,es;q=0.4,it;q=0.3,pt;q=0.2,pt-PT;q=0.1

il try soem other solutions
      
avatar
Date: 2013-03-12 05:05
Posted By: Martin Malý (natrim)

EDIT2: fixed for now by adding cs-CZ alias to lib/nls/cs_CZ.nls.php

but probadly needs soem toher solution, as it can happen for other langs too
      
avatar
Date: 2015-03-28 18:28
Posted By: Robert Campbell (calguy1000)

fixed in svn for this language alone... as there have been no further reports.
      
avatar
Date: 2015-09-06 12:56
Posted By: Rolf (rolf1)

CMS Made Simple 1.12.1 and 2.0 are released
      
Updates

Updated: 2015-09-06 12:56
state: Open => Closed

Updated: 2015-03-28 18:28
resolution_id: 5 => 7
cmsms_version_id: 29828 => -1

Updated: 2013-03-12 05:03
description: The parsing of HTTP_ACCEPT_LANGUAGE in get_browser_languages fails in IE. IE sends something like: cs-CZ which the regexp fails to parse right (FIrefox sends it with _ ( cs_CZ ) so it goes ok) fixed by removing - from regexp preg_match_all('/([ => The parsing of HTTP_ACCEPT_LANGUAGE in get_browser_languages fails in IE. IE sends something like: cs-CZ which the regexp fails to parse right (FIrefox sends it with _ ( cs_CZ ) so it goes ok) fixed for now by adding alias to /lib/nls/cs_CZ.nls.ph

Updated: 2013-03-12 04:43
resolution_id: => 5