WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#20698 closed defect (bug) (fixed)

Minor validation errors in admin bar

Reported by: araucaria Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: minor Version: 3.3
Component: Administration Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description

Several elements in the admin bar have unwanted white space at the start of the class attribute:

<ul id="wp-admin-bar-appearance" class=" ab-submenu">

and

<li id="wp-admin-bar-search" class=" admin-bar-search">

Attachments (3)

20698.diff (1.2 KB) - added by MattyRob 7 years ago.
20698v2.diff (1.1 KB) - added by MattyRob 7 years ago.
Ternary operator fix
20698.2.diff (942 bytes) - added by nacin 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @MattyRob
7 years ago

  • Keywords has-patch dev-feedback added

I've confirmed this with trunk code at rev 20826.

I've played about with the class-wp-admin-bar.php file and I think I've got a fix too.

@MattyRob
7 years ago

@MattyRob
7 years ago

Ternary operator fix

@nacin
7 years ago

#2 @nacin
7 years ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 3.5
  • Version changed from 3.3.2 to 3.3

While both patches probably work, we can make the intent a bit clearer. Try 20698.2.diff. (And when in doubt, a trim() can sweep most awkward logic branches under the rug.)

#3 @nacin
7 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21193]:

Don't output empty class names or ones with leading/trailing spaces. props MattyRob for the initial patch. fixes #20698.

Note: See TracTickets for help on using tickets.