SimpleMachines / SMF

Simple Machines Forum — SMF in short — is free and open-source community forum software, delivering professional grade features in a package that allows you to set up your own online community within minutes!
https://www.simplemachines.org/
Other
595 stars 255 forks source link

[2.1] & [3.0]: Html special chars in custom profile fields result in erroneous error #8308

Open sbulen opened 2 months ago

sbulen commented 2 months ago

Basic Information

When entering something in a custom field, e.g.: image

This error occurs upon save: image

Issue exists in 2.1 & 3.0. It appears all custom profile fields are affected.

Steps to reproduce

  1. Attempt to use an ampersand, or <, or > in a custom profile field
  2. Press save

Expected result

Updated custom profile field

Actual result

image

Version/Git revision

3.0 alpha 2 & 2.1.4

Database Engine

All

Database Version

8.4

PHP Version

8.3.8

Logs

No response

Additional Information

Issue was brought up in the forum in this thread: https://www.simplemachines.org/community/index.php?topic=589581.0

MissAllSunday commented 1 month ago

I took a look at this since I remember I worked on it, turns out there isn't a nice way to solve it, at least not one that still uses strip_tags as the function naturally removes <> and & even when used as a single chars not associated with a HTML tag.

Best course of actions would be: