diff options
| author | Steven Barth <steven@midlink.org> | 2009-01-30 15:29:53 +0000 |
|---|---|---|
| committer | Steven Barth <steven@midlink.org> | 2009-01-30 15:29:53 +0000 |
| commit | 6c83242d9d52eac636988cedd7ef5d8c69d54017 (patch) | |
| tree | ec739994c999e95fc9db99ebbffebcb8042dfe23 | |
| parent | e7234befc3c8c9adec1fdcc6b4d21c0d2b295868 (diff) | |
Fix autodetection for extended language identifiers
| -rw-r--r-- | libs/web/luasrc/dispatcher.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 24ce246dfc..5110209aac 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -134,7 +134,8 @@ function dispatch(request) local lang = conf.main.lang if lang == "auto" then local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or "" - for lpat in aclang:gmatch("[%w]+") do + for lpat in aclang:gmatch("[%w-]+") do + lpat = lpat and lpat:gsub("-", "_") if conf.languages[lpat] then lang = lpat break |
