[wp-trac] [WordPress Trac] #64673: Unnecessary Leading Space in wp-login.php Class Output

WordPress Trac noreply at wordpress.org
Thu Feb 19 23:04:03 UTC 2026


#64673: Unnecessary Leading Space in wp-login.php Class Output
------------------------------------+-----------------------------
 Reporter:  opurockey               |      Owner:  (none)
     Type:  defect (bug)            |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:  trunk
 Severity:  minor                   |   Keywords:  has-patch
  Focuses:                          |
------------------------------------+-----------------------------
 There is an unnecessary leading space in the class attribute construction
 on line 187 of wp-login.php.
 `$classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace(
 '_', '-', get_locale() ) ) );`
 The class string is generated using:

 `implode( ' ', $classes )`

 Since `implode( ' ', $classes )` in line 201 already inserts a space
 between each class name, adding an additional leading space before the
 output results in a double space in the rendered class attribute.

 **Expected Behavior**

 The class attribute should not contain a leading space. The extra space
 should be removed to ensure clean and consistent markup.

 **Proposed Fix**

 Remove the unnecessary leading space before the implode() output so that
 spacing is handled solely by `implode( ' ', $classes )`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64673>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list