Comments

karens’s picture

Pretty much a no-brainer, needed in D6 and needed here. Are we deliberately being obtuse in the description? Should we mention that it is necessary for security reasons?

yched’s picture

This specific change is actually not security related, Selects display their options as is, without interpreting HTML or encoded entities, so this patch just makes sure all incoming HTML is removed. Just cosmetic, if you wish.
The actual sec fixes went in user_ref and node_ref HEAD (which are currently still in CCK contrib).

bjaspan’s picture

StatusFileSize
new1.03 KB

I improved the comment to include the information I needed to convince myself the patch is correct. I did not change the code, so RTBC.

bjaspan’s picture

Status: Needs review » Reviewed & tested by the community
cburschka’s picture

I understand the rationale for decoding these entities, but what kind of HTML tags are being stripped? Where do they originate and why don't we want them?

Patch looks ready, though.

yched’s picture

- the custom list of allowed values for list fields can include HTML, which will be displayed normally (after filter_xss sanitization) by the radios / checkboxes widgets. The select widget, however, needs to filter this HTML out.
- some field types (nodereference, userreference) use this widget with Views-generated data. which typically includes divs / spans wrapping Views fields.

bjaspan’s picture

StatusFileSize
new1.62 KB

I think yched's explanation in #6 is even more clarifying that the comment in the patch before, so I integrated. Still no code changes, so still RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Talked this over with Barry on IRC, and we agreed a test for this would be good. It looks like our test coverage for fields outside of text.module is a bit spotty.

webchick’s picture

Issue tags: +Needs tests, +Fields in Core

.

Island Usurper’s picture

I have a hard time seeing how this can be tested in core. As far as I can see, and I'm not that familiar with fields to see far, it looks like some of CCK's functionality is needed to create a list field and instance programmatically. In particular, there isn't a way to store the allowed values except in CCK's database table. Without knowing what values are listed in the widget, you can't figure out what the default is or even post one of them as data.

My intuition tells me it should be possible to just say $instance['default_values'], but I don't see any evidence that it's actually used.

cosmicdreams’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -Fields in Core

#7: field-select-widget-409440-7.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs tests, +Fields in Core

The last submitted patch, field-select-widget-409440-7.patch, failed testing.

damienwhaley’s picture

Status: Needs work » Needs review
StatusFileSize
new6.36 KB
new21.25 KB
new19.12 KB

I'd like to take another pass at this as I recently stumbled across a similar problem.

The problem I had was that I had created a taxonomy term with an angle bracket in the name ("Before<After"), and what I found was that the name was being truncated to "Before". I set up a test content type and added three term reference fields each with different widgets. The autocomplete worked correctly and returned "Before<After", but the radio buttons and the select list returned the truncated version of the label "Before".

I think that the behaviour should be to escape the tags using check_plain() rather than strip_tags().

The patch I've uploaded changes the behaviour escape the tags rather than strip them. It's still safe as it's escaped, and what the user sees is what has been entered in a safe form. The images uploaded show the before behaviour and after behaviour.

As a result I have also had to change the tests to account for the new behaviour.

If we think this solves the problem, then I am happy to port this to D8.

a.a.smirnov’s picture

Issue summary: View changes

Greetings to all.

It was the same problem as the patch #14 from damienwhaley help to solve it. Thank damienwhaley. :)

Drupal 7.38, php 5.5.26.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.