Raw HTML in Custom Profile Fields

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Raw HTML in Custom Profile Fields
« on February 16th, 2013, 09:34 PM »
This has multiple consequences, depending on your perspective.

So, I created a dropdown with both raw HTML and bbcode in it, as I couldn't remember whether it allowed either or neither or what. bbcode is unparsed, understandably.

Now, raw HTML is not supported as such. I'm willing to take it that this is a security measure, because the way it is implemented, the value is stored as-is in the DB and displayed without further processing later on. So it would be a security issue to just accept and handle raw HTML there, and naturally it is htmlspecialchars'ified before use.

This leads us to the interesting situation where inside the dropdown, the htmlspecialchars'ified text will be rendered as HTML inside the selectbox.

Which means there's one bug, in that the content isn't twice-parsed.


There is a separate side bug related to the selectbox. I have a piece of text with an image that's substantially bigger than a single line of text. It was the first image at hand, and was 40x40. When the selectbox is expanded, it is displayed normally. But when closed and it is the selected item, something else happens entirely. See attached. The picture shows both the expanded behaviour and the unexpanded behaviour (i.e. it doesn't change height, and the text is base-line aligned, so the text is actually out of sight)

I'm not sure what *should* be the ideal behaviour here, though.

📎 cpf_rawness.png - 23.43 kB, 1059x297, viewed 120 times.

When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Raw HTML in Custom Profile Fields
« Reply #1, on May 25th, 2013, 03:04 AM »
Quote
There is a separate side bug related to the selectbox. I have a piece of text with an image that's substantially bigger than a single line of text. It was the first image at hand, and was 40x40. When the selectbox is expanded, it is displayed normally. But when closed and it is the selected item, something else happens entirely. See attached. The picture shows both the expanded behaviour and the unexpanded behaviour (i.e. it doesn't change height, and the text is base-line aligned, so the text is actually out of sight)
Most (if not all) people using images in the options will treat them as icons. That said, I think the height should be elastic, jut like the width.
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Raw HTML in Custom Profile Fields
« Reply #2, on May 25th, 2013, 02:48 PM »
Quote from live627 on May 25th, 2013, 03:04 AM
Quote
There is a separate side bug related to the selectbox. I have a piece of text with an image that's substantially bigger than a single line of text. It was the first image at hand, and was 40x40. When the selectbox is expanded, it is displayed normally. But when closed and it is the selected item, something else happens entirely. See attached. The picture shows both the expanded behaviour and the unexpanded behaviour (i.e. it doesn't change height, and the text is base-line aligned, so the text is actually out of sight)
Most (if not all) people using images in the options will treat them as icons. That said, I think the height should be elastic, jut like the width.
Easier said than done...
I spent weeks, perhaps months on this select box rewrite... I'm proud of it, but I'm perfectly aware it has a few shortcomings.
Yet, I'm not ready to... Delve into that again..! :^^;: