mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	feat: don't overwrite req.query.lang if it exists
This commit is contained in:
		| @@ -73,11 +73,11 @@ module.exports = function (middleware) { | |||||||
|  |  | ||||||
| 	let langs = []; | 	let langs = []; | ||||||
| 	middleware.autoLocale = function autoLocale(req, res, next) { | 	middleware.autoLocale = function autoLocale(req, res, next) { | ||||||
| 		if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang) { | 		if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang || req.query.lang) { | ||||||
| 			return next(); | 			return next(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		var lang = req.acceptsLanguages(langs); | 		const lang = req.acceptsLanguages(langs); | ||||||
| 		if (!lang) { | 		if (!lang) { | ||||||
| 			return next(); | 			return next(); | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user