Skip to content

Node.js based forum software built for the modern web

explicitly cast jobsDisabled as Boolean

Julian Lama48c914a165d
diff --git a/app.js b/app.js
index 77da25936d..de5642e515 100644
--- a/app.js
+++ b/app.js
@@ -117,6 +117,17 @@ function loadConfig(callback) {
nconf.set('url_parsed', url.parse(nconf.get('url')));
}
+ // Explicitly cast 'jobsDisabled' as Bool
+ var castAsBool = ['jobsDisabled'];
+ nconf.stores.env.readOnly = false;
+ castAsBool.forEach(function (prop) {
+ var value = nconf.get(prop);
+ if (value) {
+ nconf.set(prop, typeof value === 'boolean' ? value : String(value).toLowerCase() === 'true');
+ }
+ });
+ nconf.stores.env.readOnly = true;
+
if (typeof callback === 'function') {
callback();
}