#58146 closed defect (bug) (fixed)
HTML API: Ensure attribute updates happen only once for case variants
Reported by: | dmsnell | Owned by: | Bernhard Reiter |
---|---|---|---|
Milestone: | 6.2.1 | Priority: | normal |
Severity: | normal | Version: | 6.2 |
Component: | HTML API | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Github PR: #4337
When setting a new value for an attribute multiple times and providing
multiple case variations of the attribute name the Tag Processor has
been appending multiple copies of the attribute into the updated HTML.
This means that only the first attribute set determines the value in
the final output, plus the output will appear wrong.
In this patch we're adding a test to catch the situation and resolving it
by using the appropriate comparable attribute name as a key for storing
the updates as we go. Previously we stored updates to the attribute by
its given $name
, but when a new update of the same name with a
case variant was queued, it would not override the previously-enqueued
value as it out to have.
This bug has not been reported or known to be exposed.
Reproduce in trunk
by enqueuing multiple updates to a given
attribute with different case variants while visiting a single tag
with the Tag Processor. (See included unit tests).
Change History (10)
This ticket was mentioned in PR #4337 on WordPress/wordpress-develop by @dmsnell.
22 months ago
#1
@zieladam commented on PR #4337:
22 months ago
#2
Great fix and great catch!
#4
@
22 months ago
- Owner set to Bernhard Reiter
- Resolution set to fixed
- Status changed from new to closed
In 55659:
@Bernhard Reiter commented on PR #4337:
22 months ago
#5
Committed to Core trunk
in `r55659`.
#6
@
22 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 6.2.1 consideration.
@Bernhard Reiter commented on PR #4337:
22 months ago
#9
Backported to Core's 6.2
branch in `r55662`.
HTML API: Ensure attribute updates happen only once for case variants
Trac ticket: #58146-trac
When setting a new value for an attribute multiple times and providing
multiple case variations of the attribute name the Tag Processor has
been appending multiple copies of the attribute into the updated HTML.
This means that only the first attribute set determines the value in
the final output.
In this patch we're adding a test to catch the situation, and then fixing
the bug by using the comparable name to key the attribute updates instead
of the case-sensitive name.