Skip to content

Commit

Permalink
Merge branch 'main' into env-file-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodacus authored Dec 18, 2024
2 parents 62ebfe5 + 6003c16 commit e74d6ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/commit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "commit": "fce8999f27c0affbc762dc90de992b5a759ab325" }
{ "commit": "e064803955604198c6aac7b257efd0ad8503cb73", "version": "0.0.3" }
5 changes: 3 additions & 2 deletions app/lib/hooks/useEditChatDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ export function useEditChatDescription({
}

const lengthValid = trimmedDesc.length > 0 && trimmedDesc.length <= 100;
const characterValid = /^[a-zA-Z0-9\s]+$/.test(trimmedDesc);
// Allow letters, numbers, spaces, and common punctuation but exclude characters that could cause issues
const characterValid = /^[a-zA-Z0-9\s\-_.,!?()[\]{}'"]+$/.test(trimmedDesc);

if (!lengthValid) {
toast.error('Description must be between 1 and 100 characters.');
return false;
}

if (!characterValid) {
toast.error('Description can only contain alphanumeric characters and spaces.');
toast.error('Description can only contain letters, numbers, spaces, and basic punctuation.');
return false;
}

Expand Down

0 comments on commit e74d6ca

Please sign in to comment.