Skip to content

Node.js based forum software built for the modern web

fix: #13918, make arrayLimit configurable increase default to 50

Barış Soner Uşaklıd25e7726a7d5
diff --git a/install/package.json b/install/package.json
index 5203b0b8d1..f37a7e1684 100644
--- a/install/package.json
+++ b/install/package.json
@@ -124,6 +124,7 @@
"pretty": "^2.0.0",
"progress-webpack-plugin": "1.0.16",
"prompt": "1.3.0",
+ "qs": "6.14.1",
"redis": "5.10.0",
"rimraf": "6.1.2",
"rss": "1.2.2",
diff --git a/src/webserver.js b/src/webserver.js
index 18f57faa40..1aa7f2387d 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -137,6 +137,12 @@ function setupExpressApp(app) {
app.set('view engine', 'tpl');
app.set('views', viewsDir);
app.set('json spaces', global.env === 'development' ? 4 : 0);
+
+ // https://github.com/NodeBB/NodeBB/issues/13918
+ const qs = require('qs');
+ app.set('query parser', str => qs.parse(str, {
+ arrayLimit: Math.max(100, nconf.get('queryParser:arrayLimit') || 50),
+ }));
app.use(flash());
app.enable('view cache');