Skip to content

Prevent users from saving emojis as their display name#1325

Merged
erinz2020 merged 2 commits intoWildMeOrg:mainfrom
abdulrahmanelnory1:main
Dec 12, 2025
Merged

Prevent users from saving emojis as their display name#1325
erinz2020 merged 2 commits intoWildMeOrg:mainfrom
abdulrahmanelnory1:main

Conversation

@abdulrahmanelnory1
Copy link
Copy Markdown
Contributor

Emoji Validation for Full Name Field

Added client-side validation to prevent users from entering emojis in the Full Name field on the profile page (/myAccount.jsp). This ensures the field remains searchable and readable across the platform.

Changes Made

  • New Function: containsEmoji() - Detects emojis using comprehensive Unicode regex patterns
  • Updated Function: sendButtonClicked() - Now validates Full Name for emojis before form submission
  • UX Enhancement: Users receive a clear alert message and auto-focus back to the field when emojis are detected

Files Modified

  • myAccount.jsp - Added emoji validation logic in JavaScript section

PR fixes #1324

Before you Submit!

  • ⚠️ Is all the text internationalized? - Alert message hardcoded in English, needs i18n
  • If you made a change to the header, did you update the react, jsp, and html? - N/A
  • Are all dependencies at a locked version? - No new dependencies
  • Did you adhere to best practices? - Yes
  • Is there a quick unit test you can add? - Client-side validation; manual testing recommended

@vkirkl vkirkl requested a review from erinz2020 December 10, 2025 04:11
Copy link
Copy Markdown
Contributor

@erinz2020 erinz2020 left a comment

Choose a reason for hiding this comment

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

LGTM! thank you for working on the emoji validation! the regex covers most common cases well.

suggestion: consider using \p{Emoji} with a fallback for better coverage and maintainability.
benefits:
simpler and more maintainable
catches edge cases like ⭐
future-proof for new emojis

but if you prefer to keep the current implementation for maximum browser compatibility, that's fine too. Up to you!
I'll approve the PR.

@abdulrahmanelnory1
Copy link
Copy Markdown
Contributor Author

I've implemented your suggestion and updated the PR to use \p{Emoji}. Thanks for the tip!

@erinz2020
Copy link
Copy Markdown
Contributor

I've implemented your suggestion and updated the PR to use \p{Emoji}. Thanks for the tip!

perfect! i'll go ahead and merge it, so it goes to 10.9. thanks again for your contribution!

@erinz2020 erinz2020 merged commit 3694615 into WildMeOrg:main Dec 12, 2025
@erinz2020 erinz2020 requested a review from NNattoji December 12, 2025 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent users from saving emojis as their display name

2 participants