Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#11327 closed defect (bug) (wontfix)

Widgets might get null bytes in their CSS class

Reported by: qualipsoft Owned by: azaozz
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: Widgets Keywords: widgets css class has-patch
Focuses: Cc:


When register_sidebar_widget is called with a lambda/create_function as output_callback and no/empty classname, the widget's CSS class will contain "\0lamba_123" (\0 being the null character and 123 being the actual assigned lamba id).

This bug was introduced in 2.3 by #4910 (In [6098]).

The simple fix might be to left-trim null bytes from the classname (this would fix the case for lambda's, and maybe other cases I'm not aware of)

Attachments (1)

null-in-widget-classname.patch (478 bytes) - added by qualipsoft 8 years ago.

Download all attachments as: .zip

Change History (3)

#1 @scribu
8 years ago

  • Component changed from General to Widgets
  • Owner set to azaozz

The patch looks ok, but I don't know if it's worth fixing, since you should be using the new WP_Widget class, instead of setting each handler manually.

#2 @azaozz
8 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Scribu is right, support for 'old style' wigets is currently deprecated will probably be removed in 3.0.

Note: See TracTickets for help on using tickets.