1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Added validation while export into library

This commit is contained in:
Arun Nattarayan 2018-11-30 20:04:12 +05:30
parent 2f93bb969b
commit 06a1f30350

View File

@ -447,7 +447,9 @@ RED.library = (function() {
click: function() { click: function() {
//TODO: move this to RED.library //TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val(); var flowName = $("#node-input-library-filename").val();
if (!/^\s*$/.test(flowName)) { if(flowName.split(/[\\/]/).pop() === "" || /^\s*$/.test(flowName)) {
RED.notify(RED._("library.invalidFilename"),"warning");
} else {
$.ajax({ $.ajax({
url:'library/flows/'+flowName, url:'library/flows/'+flowName,
type: "POST", type: "POST",