WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 7 months ago

#47976 new defect (bug)

HTML attributes in uppercase show error in widgets

Reported by: sudhir600 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9
Component: Widgets Keywords: has-screenshots dev-feedback has-patch
Focuses: administration Cc:

Description

(1) How to reproduce
go to p-admin/widgets.php and add custom HTML.
in custom html box if i add this html, it will error.

<div id="abcd" DATA-HREF="xerjss"></div>

(2) Error - the attribute name of [ "DATA-HREF" ] must be in lowercase.

(3) Why need this
some ad providers (such as flipkart) supply code where attributes are uppercase.

Attachments (2)

widget error for uppercase attributes.jpg (41.9 KB) - added by sudhir600 2 years ago.
47976.diff (528 bytes) - added by sabernhardt 7 months ago.
disabling the attr-lowercase rule

Download all attachments as: .zip

Change History (7)

#1 @mukesh27
2 years ago

  • Focuses ui removed
  • Keywords has-screenshots dev-feedback added

#2 @FlorianBrinkmann
2 years ago

I am having the same issue: I tried to add an SVG with the viewBox attribute, but am not able to save it because of the »error«.

#3 @navjotjsingh
12 months ago

  • Version set to 5.5.2

Can anyone take a look at this? Even I am having the same problem as @FlorianBrinkmann with using SVG code.

#4 @Nomadsteam
7 months ago

  • Type changed from enhancement to defect (bug)

Same issue here. Cannot save an HTML widget with attribute "viewBox" (WP 5.7).
Error: The attribute name of [ viewBox ] must be in lowercase.

@sabernhardt
7 months ago

disabling the attr-lowercase rule

#5 @sabernhardt
7 months ago

  • Keywords has-patch added
  • Version changed from 5.5.2 to 4.9

47976.diff simply disables the error for uppercase letters in attributes.

If the error is important to keep for most situations, the attr-lowercase rule could have an array of specific exceptions instead:

['viewBox', 'DATA-HREF']

HTMLHint user guide

Note: See TracTickets for help on using tickets.