From 94ae511a6d8a285eaf9faa80aefa6cca8225f66f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Mon, 9 Jan 2023 09:26:24 +0000 Subject: [PATCH] fix tcp to replace all in newline substitution to close #3989 --- packages/node_modules/@node-red/nodes/core/network/31-tcpin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js b/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js index d2de33522..d95d03b10 100644 --- a/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js +++ b/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js @@ -86,7 +86,7 @@ module.exports = function(RED) { this.topic = n.topic; this.stream = (!n.datamode||n.datamode=='stream'); /* stream,single*/ this.datatype = n.datatype||'buffer'; /* buffer,utf8,base64 */ - this.newline = (n.newline||"").replace("\\n","\n").replace("\\r","\r").replace("\\t","\t"); + this.newline = (n.newline||"").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t"); this.base64 = n.base64; this.trim = n.trim || false; this.server = (typeof n.server == 'boolean')?n.server:(n.server == "server");