[3.0] Correctly handles quotes in mentions, plus other entity-related fixes #8860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 viaUtils::htmlspecialcharsRecursive(). In previous versions of SMF, that function always forced theENT_QUOTESflag to be used, but in 3.0 it was changed to allow the caller to set the flags and to useENT_COMPATby default, just likeUtils::htmlspecialchars()does. This issue has been fixed by specifyingENT_QUOTESin all calls toUtils::htmlspecialcharsRecursive()where it was expected.'entities. You will need to fix them yourself.Makes several other improvements to our handling of HTML entities, including:
grapheme_*functions from theintlextension, and then uses them to simplify code in theSMF\Utils::entity*methods.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