mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add validation of library plugin id and better error reporting
This commit is contained in:
@@ -38,6 +38,11 @@ function init(runtime) {
|
||||
runtimeLibraries.forEach(library => {
|
||||
if (library.type === id) {
|
||||
library.local = false;
|
||||
|
||||
if (!/^[a-z0-9-_]+$/.test(library.id)) {
|
||||
log.warn(log._("library.failedToInit",{error:log._("library.invalidProperty",{prop:"id",value:library.id})}));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
libraries[library.id] = new plugin.class(library)
|
||||
libraryConfigs[library.id] = library;
|
||||
|
Reference in New Issue
Block a user