Custom Profile Fields errors

Started by chadon, May 15, 2022, 06:51:26 AM

Previous topic - Next topic

chadon

I have text custom profile fields setup on my forum with "no HTML" input masks but since the 2.1.2, the forum gives a "no HTML allowed" message when an user tries to modify his profile when he has a character with an accent like "é".
These custom profile fields have been set years ago so it will impact most users and we never had this issue before.


Steve

DO NOT pm me for support!

hungarianguy

For forums with languages with special characters like hungarian having utf8 is a must.

chadon


Doug Heffernan

Quote from: chadon on May 15, 2022, 06:51:26 AMbut since the 2.1.2,

I take it that it worked before. What version did you upgrade from?

What about this?

Quote from: Steve on May 15, 2022, 09:16:56 AMAnd you're on UTF-8?

Steve

He did say he was on UTF-8 Doug, unless he was replying to hungarianguy.  :)
DO NOT pm me for support!

Arantor

So this is a behaviour that changed in SMF 3 months ago in a bid to fix PHP 8.1 support but I think it's gone awry because it's failing on a comparison that's probably no longer true at this point in time if you have anything with accented letters in it.

Specifically it's this part of Profile-Modify.php:

if ($row['mask'] == 'nohtml' && ($valueReference != strip_tags($valueReference) || $value != filter_var($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS) || preg_match('/<(.+?)[\s]*\/?[\s]*>/si', $valueReference)))
{
if ($returnErrors)
$errors[] = 'custom_field_nohtml_fail';

else
$value = '';
}

The fact that this has broken existing valid cases would suggest to me it is a bug.

chadon

Quote from: Doug Heffernan on May 15, 2022, 11:41:50 AMI take it that it worked before. What version did you upgrade from?
I updated from 2.1.1 to 2.1.2

Quote from: Doug Heffernan on May 15, 2022, 11:41:50 AMWhat about this?
I am on UTF-8

Quote from: Steve on May 15, 2022, 12:21:21 PMHe did say he was on UTF-8 Doug, unless he was replying to hungarianguy.  :)
My reply was for both of them.  ;D

Oldiesmann

Confirmed to be a bug. Same thing happens on my test board (2.1.2, PHP 8.1)
Michael Eshom
Christian Metal Fans

Oldiesmann

Forgot to edit my previous post, but this is tracked on GitHub: https://github.com/SimpleMachines/SMF/issues/7465
Michael Eshom
Christian Metal Fans

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: