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

Overlapping mqtt subs get duplicate messages

This commit is contained in:
Nicholas O'Leary 2013-12-06 14:19:21 +00:00
parent ce7bf78349
commit 4475e74187

View File

@ -20,7 +20,7 @@ var settings = require(process.env.NODE_RED_HOME+"/red/red").settings;
var connections = {}; var connections = {};
function matchTopic(ts,t) { 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); return re.test(t);
} }