Check fallbacks correctly in getHeaderVariant().
authorLiangent <liangent@gmail.com>
Thu, 23 Aug 2012 19:21:01 +0000 (03:21 +0800)
committerLiangent <liangent@gmail.com>
Thu, 23 Aug 2012 19:21:01 +0000 (03:21 +0800)
commita6d845f5c2e969d17b40777c54aaf067f4bd7541
tree5db77bf66f9d694668a96b42c32709fcee362e99
parentd01e0225ea8198c1df188ee88ee294b95950ee7e
Check fallbacks correctly in getHeaderVariant().

Currently when users with Accept-Language: en accesses a zh site,
getVariantFallbacks() returns zh for it and zh is treated as their
preferred variant as header variant, making the configuration
setting $wgDefaultLanguageVariant ignored.

Per comments above getVariantFallbacks(), it returns the main
language code for an unknown variant (en in this case), so when
it's returning the main code, just ignore this fallback (when the
user is really sending Accept-Language: zh, it can be caught by
validateVariant() above and fallbacks are not consulted).

Change-Id: I187bdcd70b778883cc80ceeab005de3aca2e286a
languages/LanguageConverter.php