diff --git a/src/emqttd_topic.erl b/src/emqttd_topic.erl index 934362499..91cd0ff08 100644 --- a/src/emqttd_topic.erl +++ b/src/emqttd_topic.erl @@ -61,9 +61,9 @@ wildcard([_H|T]) -> -spec(match(Name, Filter) -> boolean() when Name :: topic() | words(), Filter :: topic() | words()). -match(<<"$", _/binary>>, <<"+", _/binary>>) -> +match(<<$$, _/binary>>, <<$+, _/binary>>) -> false; -match(<<"$", _/binary>>, <<"#", _/binary>>) -> +match(<<$$, _/binary>>, <<$#, _/binary>>) -> false; match(Name, Filter) when is_binary(Name) and is_binary(Filter) -> match(words(Name), words(Filter));