SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Html entity oddities in custom profile field

Open AngelinaBelle opened this issue 12 years ago • 18 comments

At registration, entered Don't in a custom profile field of type large text. This text turned out to be Don't when it displayed (above signature) and in profile (account settings)

Attempts to fix in account settings result in same text being stored. I think. There is something else odd going on in that page.

AngelinaBelle avatar Jun 04 '14 17:06 AngelinaBelle

can you provide a screenshot of the issue? i am not following what exactly is happening that should not.

illori avatar Jun 04 '14 17:06 illori

! Looks like Github fixed it for me! image

Becomes

image

AngelinaBelle avatar Jun 04 '14 17:06 AngelinaBelle

It looks like htmlspecialchars() is being applied when you save the data, but it's not being undone when the data is loaded for edit. Should be a pretty simple fix.

Oldiesmann avatar Jun 04 '14 17:06 Oldiesmann

this is not an issue with a mobile device it is an issue with smf on any browser. also it can occur with a normal text box

illori avatar Jun 04 '14 17:06 illori

I changed the title.

The result looks dumb, though. As though htmlspecialcharacters got applied twice. image

AngelinaBelle avatar Jun 04 '14 17:06 AngelinaBelle

My guess is it's being applied each time you save the field (which would make sense), but since it's not being stripped before editing, it keeps getting applied'. If you edit and save it again you'll probably see something like ' instead of '

Oldiesmann avatar Jun 05 '14 04:06 Oldiesmann

Not fixed yet.

  • looks correct when I view in account settings
  • still looks like a mess as part of a post

AngelinaBelle avatar Jun 09 '14 15:06 AngelinaBelle

Can you please verify your Sources/Load.php file, line 1251 and check if you have this line there:

            '{INPUT}' => un_htmlspecialchars($row['value']),

If not, the branch you're testing on is outdated and should be updated with the latest commits, dunno how exactly are you testing or what you're using to test so I can't give you proper instructions to fetch and merge the latet changes to SMF release-2.1 your local branches.

MissAllSunday avatar Jun 09 '14 22:06 MissAllSunday

@kindred can you verify that line? i believe AB has been testing on your test forum.

illori avatar Jun 09 '14 22:06 illori

Please reopen this issue. This issue was closed with a fix on Thursday. On Sunday, Kindred grabbed the latest version and updated the website. So -- probably. Have you tested the fix in a custom profile field?

There clearly is a change in behavior since I first reported the problem. It just is not all the way there.

AngelinaBelle avatar Jun 10 '14 11:06 AngelinaBelle

I'm sorry, I cannot reopen an issue based solely on a "So -- probably".

meh, anyway, I know whats the problem here, it would have been awesome if you had indeed provided more details about how you were testing this, perhaps mentioning that you weren't using any enclosing text.

While testing custom profile fields it would be awesome if the following info is provided:

  • Profile section
  • if show on registration
  • if show on topic view
  • if show on memberlist
  • placement
  • if showing with enclosed text
  • field type
  • max length -if allow bbc
  • input mask and the regex used if using the regex option.
  • privacy
  • searchable
  • active

This hugely improves debugging.

If you do not have access to all those fields, (if you're testing on someone elses site) then I invite you to mount a forum on a local environment via wamp or xampp.

And Kindred's account here is @Kindred-999

MissAllSunday avatar Jun 10 '14 13:06 MissAllSunday

i forgot he had a different name here... too used to the nick on the forum.

illori avatar Jun 10 '14 13:06 illori

Thank you for your request for additional information about how the profile field is used. I will qualify "probably" to "99% certain, based on date of commit and date of download"

I do not currently have the capacity to make an Xampp or Wamp install, for which I apologize most profoundly.

Please let me know if you would like me to cease testing at this time.


Edited: account settings Show on registration: yes and require Topic view: no Member list: no Placement: before signature Enclosed within text: blank

Type: large text Max: 255 Dims: 4. 30 Allow bbc: yes

Privacy: users see; owner edit Searchable: yes Active: yes

AngelinaBelle avatar Jun 10 '14 13:06 AngelinaBelle

You cannot test the recent change until its applied to whatever you're using to test.

I never said I want you to cease testing, all I said was that I need more info and details to help me identify any problems that still remains. No info/details equals no fix, as simple as that. Ceasing to test will certainly do nothing towards fixing the issue, providing detailed info does.

MissAllSunday avatar Jun 10 '14 14:06 MissAllSunday

Thank you for your recent fix. Did it test well when you tried it out? I will test it myself as soon as I am able, and will be sure to report back here once I have.

AngelinaBelle avatar Jun 10 '14 14:06 AngelinaBelle

There is really nothing to test, un_htmlspecialchars() will solve the problem, it was used on the wrong place because I naively thought only input with enclosed text had this issue, I moved un_htmlspecialchars() to the right place.

MissAllSunday avatar Jun 10 '14 15:06 MissAllSunday

Information:

Updated with build on 23:15 8-Jun-2014 EDT Field Type: Large Text Show: Above Signature Profile Section: Account Settings Registration: Yes and require entry max Length: 255 4 rows by 30 columns Allows BBC (yes) searchable (yes)

http://test2.turtleshellprod.com/index.php?topic=35.msg88#msg88 this displays: this is a test blurb. "I'm not sure what to make of it", she said !?@&$)(;:/-1234567890

It should display this is a test blurb."I'm not sure what to make of it", she said !?@#$%^&*)(;:/-1234567890

so, it looks like " double quote ' single quote hash & ampersand % percent ^ carat asterisk seem to get improperly converted or removed...

Kindred-999 avatar Jun 10 '14 16:06 Kindred-999

This problem appears to have been fixed

AngelinaBelle avatar Jun 18 '14 20:06 AngelinaBelle