News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

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

My pet rock is not feeling well. I think it's stoned.

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.  :)
My pet rock is not feeling well. I think it's stoned.

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.
Holder of controversial views, all of which my own.


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

A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: