mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
handle secondary subtags between 2 and 8 characters long, as
per RFC 3066 et al. when setting accept-lang header (bug 293327)
This commit is contained in:
parent
e604f9264e
commit
0e1f096534
@ -314,7 +314,11 @@ static BOOL gMadePrefManager;
|
||||
[language appendString:[[localeParts objectAtIndex:1] lowercaseString]];
|
||||
}
|
||||
|
||||
if ( [language length] == 2 || ( [language length] == 5 && [language characterAtIndex:2] == '-' ) )
|
||||
// We accept standalone primary subtags (e.g. "en") and also
|
||||
// a primary subtag with additional subtags of between two and eight characters long
|
||||
// We ignore i- and x- primary subtags
|
||||
if ( [language length] == 2 ||
|
||||
( [language length] >= 5 && [language length] <= 13 && [language characterAtIndex:2] == '-' ) )
|
||||
r = [NSString stringWithString:language];
|
||||
}
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user