Olá, há um bug no Chat que permite enviar mensagens vazias que contêm apenas espaços. Procurei nas configurações, mas não encontrei nada que pudesse me ajudar. Obrigado.
3 curtidas
sam
(Sam Saffron)
Maio 22, 2023, 6:53am
2
Legítimo… isso é uma falha e certamente parece estranho… deveríamos banir “branco” tanto no lado do servidor quanto no lado do cliente.
Branco é um bicho complicado
When we have seen the same issue, we simply fence them with MD.
<here is the good stuff>
<here is the sweet stuff>
```<here is the good stuff>```
`<here is the sweet stuff>`
Hi there, I just installed discourse and found out that it didn’t support Zero Width Space at all. It is Khmer Unicode special character that represents a hidden space to separate each word. you can take a look here http://www.askcambodia.org/t/angelababy/21
@@whitespaces_regexp =
Regexp.new(
"(\u00A0|\u1680|\u180E|[\u2000-\u200A]|\u2028|\u2029|\u202F|\u205F|\u3000)",
Regexp::IGNORECASE,
).freeze
def self.normalize_whitespaces(text)
text&.gsub(@@whitespaces_regexp, " ")
end
Recomendo que usemos nosso limpador de texto aqui também no lado do servidor para garantir que as pessoas não trapaceiem a si mesmas.
4 curtidas
j.jaffeux
(Joffrey Jaffeux)
Junho 8, 2023, 6:20am
5
Corrigimos isso neste commit:
committed 06:06AM - 08 Jun 23 UTC
This fixes an issue where a user could send an empty
string as a chat message .… e.g ' ' and the message would
be posted. We don't want this, we need to strip the message
first before validating for length etc.
Obrigado!
6 curtidas