Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function sanitizeString(str: string | undefined): string | undefined {
.replace(/[\u0300-\u036F]/g, "")
.trim()
.replace(/\n{3,}/g, "\n\n")
.replace(/\s{3,}/g, " ");
.replace(/[^\S\r\n]{3,}/g, " ");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied the regex fix here to ensure newlines aren't accidentally deleted by the backend when users save the profile.

}

const suffixes = ["th", "st", "nd", "rd"];
Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/src/validation/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function sanitizeString(str: string | undefined): string | undefined {
.replace(/[\u0300-\u036F]/g, "")
.trim()
.replace(/\n{3,}/g, "\n\n")
.replace(/\s{3,}/g, " ");
.replace(/[^\S\r\n]{3,}/g, " ");
Comment thread
bijanmurmu marked this conversation as resolved.
Outdated
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied the exact same fix here as well. Since the function is currently duplicated in the schemas package, I wanted to make sure the bug was completely squashed everywhere it's used.

}

function containsDisallowedWords(
Expand Down
Loading