Disallow store names that are not A-Za-z0-9_

This commit is contained in:
Nick O'Leary
2018-07-16 16:44:33 +01:00
parent d9d15e41c7
commit 75c29f1cb7
3 changed files with 13 additions and 20 deletions

View File

@@ -56,6 +56,9 @@ function load() {
if (pluginName === "_") {
continue;
}
if (!/^[a-zA-Z0-9_]+$/.test(pluginName)) {
return reject(new Error(log._("context.error-invalid-module-name", {name:pluginName})));
}
// Check if this is setting the 'default' context to be a named plugin
if (pluginName === "default" && typeof plugins[pluginName] === "string") {