Skip to content

Conversation

@Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Aug 19, 2025

Fixes #8820
Closes #8837

  • The underlying issue that made this more difficult to fix in 3.0 was that member names were being saved with unescaped apostrophe characters rather than ' entities, but the mention code assumed the entities would be used. This issue affected not only member names, but various other things that are processed via Utils::htmlspecialcharsRecursive(). In previous versions of SMF, that function always forced the ENT_QUOTES flag to be used, but in 3.0 it was changed to allow the caller to set the flags and to use ENT_COMPAT by default, just like Utils::htmlspecialchars() does. This issue has been fixed by specifying ENT_QUOTES in all calls to Utils::htmlspecialcharsRecursive() where it was expected.

    • NOTE TO DEVS, TESTERS, AND EARLY ADOPTERS: This PR does not magically replace any unencoded apostrophe characters in your database with ' entities. You will need to fix them yourself.
  • Makes several other improvements to our handling of HTML entities, including:

  • This PR also updates jquery.atwho.min.js to version 1.5.4. Doing this made it unnecessary to add the custom override that was added to mentions.js in [2.1] Fix quotes in names for mention handling #8838. We may want to update jquery.atwho.min.js in SMF 2.1 as well so that we can get rid of that customization there, too.

  • Finally, based on all the changes above, Correctly handles quotes in mentions

This is necessary because the htmlspecialchars__recursive() function in 2.x always used ENT_QUOTES, whereas Utils::htmlspecialcharsRecursive() defaults to ENT_COMPAT in order to align with Utils::htmlspecialchars().

Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
@Sesquipedalian Sesquipedalian added Mentions Charset/Encoding UTF8 & mb4 encoding related issues labels Aug 19, 2025
@Sesquipedalian Sesquipedalian changed the title [3.0] [3.0] Correctly handles quotes in mentions, plus other entity-related fixes Aug 19, 2025
@jdarwood007
Copy link
Member

It's fine to update at.js for now. @live627 commented in #8132 that the theme PR #7933 will replace this with something native.

@Sesquipedalian Sesquipedalian merged commit a50b51a into SimpleMachines:release-3.0 Aug 20, 2025
7 checks passed
@Sesquipedalian Sesquipedalian deleted the 3.0/apostrophe_mentions branch August 20, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Charset/Encoding UTF8 & mb4 encoding related issues Mentions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.1 & 3.0]: Mentions don't work for names with apostrophes

2 participants