bcosca/fatfree — pull request #55 by xfra35 (2012-07-12 21:34:51+00:00)
Title: ICU auto-detect minor fixes

Hi, here are 2 small fixes for the ICU auto-detect feature :

- the first one is concerning the case where a browser is sending multiple language tags in the Accept-Language header: the boundary would then be a comma or a semi-colon. The fix also allows 2 letter tags (both "en" and "en-US" are correct). My browser was sending this header `da,fr;q=0.8,en-us;q=0.5,en;q=0.3` which was not understood.

- the second one is concerning the case where a browser is not sending the Accept-Language header. In that case, we should restrict the language tag to 2 letters not to raise an error "Undefined index" when we read the $languages variable a few lines later. I noticed that problem on a bugged Safari which was not sending the header at all. The script was failing to terminate properly, trying to read `$languages['da_DK']`.