jeresig / i18n-node-2

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
507 stars 79 forks source link

Fix error when req.query.lang is an array #46

Closed framp closed 9 years ago

framp commented 9 years ago

If req.query.lang is an array, i18n-node-2 will try to call toLowerCase on an array making the request fail.

gjuchault commented 9 years ago

If you do mean ?lang[]=en&lang[]=fr, how should node-i18n-2 respond ?

framp commented 9 years ago

I don't think it should respond in any way as it's undefined behaviour. This happened because some random user fiddled with the URL and I logged the crash.

It's enough not to crash the whole application.

gjuchault commented 9 years ago

Fair enough !