Compare commits

...
3 Commits
Author SHA1 Message Date
Wyatt Johnson 94e1c75c0b chore: bump version 5.5.1 (#2832) 2020-02-10 17:11:14 +00:00
Hector NievaandWyatt Johnson 3014017976 Fix regexp mathing of banned word list by exchanging .test() with .match() (#2828)
* [Fix] Use .match instead of .test to avoid false positives when matching regex returned groups

* Add test to assure memoized regexp for banned words will match properly

* fix: fixes bug with wordlist matching

Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
2020-02-08 00:28:08 +00:00
Sami Safatli 1388e0bc5e Update translation pt-BR (#2826) 2020-02-06 13:38:55 -05:00
6 changed files with 37 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "5.5.0",
"version": "5.5.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "5.5.0",
"version": "5.5.1",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
@@ -1,4 +1,7 @@
import { containsMatchingPhrase } from "coral-server/services/comments/pipeline/wordList";
import {
containsMatchingPhrase,
containsMatchingPhraseMemoized,
} from "coral-server/services/comments/pipeline/wordList";
const phrases = [
"cookies",
@@ -44,3 +47,20 @@ describe("containsMatchingPhrase", () => {
expect(containsMatchingPhrase([], "test")).toEqual(false);
});
});
describe("containsMatchingPhraseMemoized", () => {
it("return true for all cases after memoizing the first result", () => {
[
"cookies 1",
"cookies 2",
"cookies 4",
"cookies 5",
"this is for cookies 6",
"this is for cookies 7",
"this is for cookies 8",
"this is for cookies 9",
].forEach(word => {
expect(containsMatchingPhraseMemoized(phrases, word)).toEqual(true);
});
});
});
@@ -22,7 +22,7 @@ export function generateRegExp(phrases: string[]) {
.join('[\\s"?!.]+')
)
.join("|");
return new RegExp(`(^|[^\\w])(${inner})(?=[^\\w]|$)`, "gmiu");
return new RegExp(`(^|[^\\w])(${inner})(?=[^\\w]|$)`, "miu");
}
export const generateRegExpMemoized = memoize(generateRegExp);
+12
View File
@@ -117,6 +117,18 @@ configure-general-sitewideCommenting-message = Mensagem de Comentários Fechados
configure-general-sitewideCommenting-messageExplanation =
Escreva uma mensagem que será exibida quando o fluxo de comentários estiver fechado em todo o site
configure-general-announcements-title = Anúncio da comunidade
configure-general-announcements-description =
Adicione um anúncio temporário que aparecerá na parte superior de todos os fluxos de comentários da sua organização por um período específico.
configure-general-announcements-delete = Remover anúncio
configure-general-announcements-add = Adicionar anúncio
configure-general-announcements-start = Começar anúncio
configure-general-announcements-cancel = Cancelar
configure-general-announcements-current-label = Anúncio atual
configure-general-announcements-current-duration =
Este anúncio irá ser encerrado automaticamente em: { $timestamp }
configure-general-announcements-duration = Mostrar este anúncio para
### Closing Comment Streams
configure-general-closingCommentStreams-title = Fechando fluxos de comentários
configure-general-closingCommentStreams-explanation = Defina fluxos de comentários para fechar após um período de tempo definido após a publicação de uma história
+1 -1
View File
@@ -48,7 +48,7 @@ install-createYourAccount-confirmPasswordTextField =
install-permittedDomains-stepTitle = Adicionar domínios permitidos
install-permittedDomains-title = Domínios Permitidos
install-allowedDomains-description-with-schema =
install-permittedDomains-description-with-schema =
   Digite os domínios que você deseja permitir para { -product-name }, por exemplo
   seus ambientes locais, de preparação e produção, incluindo o
   protocolo (por exemplo, http: // localhost: 3000, https://staging.domain.com,