From 4475e7418740fe753881ddf9087ad0bb9e6d6fac Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Fri, 6 Dec 2013 14:19:21 +0000 Subject: [PATCH] Overlapping mqtt subs get duplicate messages --- nodes/core/io/lib/mqttConnectionPool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes/core/io/lib/mqttConnectionPool.js b/nodes/core/io/lib/mqttConnectionPool.js index 6b31dea65..ee6f90e0d 100644 --- a/nodes/core/io/lib/mqttConnectionPool.js +++ b/nodes/core/io/lib/mqttConnectionPool.js @@ -20,7 +20,7 @@ var settings = require(process.env.NODE_RED_HOME+"/red/red").settings; var connections = {}; function matchTopic(ts,t) { - var re = new RegExp("^"+ts.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/#$/,".*")); + var re = new RegExp("^"+ts.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/#$/,".*")+"$"); return re.test(t); }