mirror of https://github.com/node-red/node-red.git
Merge pull request #4416 from node-red/mqtt-check-topic-length
check topic length > 0 before publishpull/4417/head^2
commit
c6a8eee73d
|
@ -104,6 +104,7 @@ module.exports = function(RED) {
|
|||
* @returns `true` if it is a valid topic
|
||||
*/
|
||||
function isValidPublishTopic(topic) {
|
||||
if (topic.length === 0) return false;
|
||||
return !/[\+#\b\f\n\r\t\v\0]/.test(topic);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue