mirror of https://github.com/node-red/node-red.git
Stricter validator for flow file name in project feature
parent
6a75a084ad
commit
a401ea9216
|
|
@ -720,7 +720,7 @@ RED.projects = (function() {
|
|||
var validateForm = function() {
|
||||
var valid = true;
|
||||
var flowFile = projectFlowFileInput.val();
|
||||
if (flowFile === "" || !/\.json$/.test(flowFile)) {
|
||||
if (flowFile === "" || !/^[a-zA-Z0-9\-_]+\.json$/.test(flowFile)) {
|
||||
valid = false;
|
||||
if (!projectFlowFileInput.hasClass("input-error")) {
|
||||
projectFlowFileInput.addClass("input-error");
|
||||
|
|
@ -1142,7 +1142,7 @@ RED.projects = (function() {
|
|||
|
||||
} else if (projectType === 'empty') {
|
||||
var flowFile = projectFlowFileInput.val();
|
||||
if (flowFile === "" || !/\.json$/.test(flowFile)) {
|
||||
if (flowFile === "" || !/^[a-zA-Z0-9\-_]+\.json$/.test(flowFile)) {
|
||||
valid = false;
|
||||
if (!projectFlowFileInput.hasClass("input-error")) {
|
||||
projectFlowFileInput.addClass("input-error");
|
||||
|
|
|
|||
Loading…
Reference in New Issue