Fixed chat escaping

Signed-off-by: WolverinDEV <git@teaspeak.de>
This commit is contained in:
WolverinDEV 2019-12-20 18:48:37 +01:00
parent c4c445d987
commit dd4a0af83f
No known key found for this signature in database
GPG key ID: 77A6C15085150EEB

View file

@ -503,18 +503,20 @@ namespace chat {
log.debug(LogCategory.GENERAL, tr("Chat message contains URL: %o"), url);
if(url.protocol !== 'http:' && url.protocol !== 'https:')
break _try;
if(flag_escaped)
if(flag_escaped) {
message = undefined;
words[index] = unescaped;
else {
} else {
message = undefined;
words[index] = "[url=" + url.toString() + "]" + url.toString() + "[/url]";
}
} catch(e) { /* word isn't an url */ }
if(unescaped.match(URL_REGEX)) {
if(flag_escaped)
if(flag_escaped) {
message = undefined;
words[index] = unescaped;
else {
} else {
message = undefined;
words[index] = "[url=" + unescaped + "]" + unescaped + "[/url]";
}