[wp-trac] [WordPress Trac] #58251: Escaping issue found while echoing attribute's dynamic value in html attribute.
WordPress Trac
noreply at wordpress.org
Fri May 5 16:01:09 UTC 2023
#58251: Escaping issue found while echoing attribute's dynamic value in html
attribute.
---------------------------+-------------------------------
Reporter: madhusudandev | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Toolbar | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: coding-standards
---------------------------+-------------------------------
Comment (by SergeyBiryukov):
Replying to [comment:8 audrasjb]:
> Replying to [comment:6 sabernhardt]:
> > In the `_render()` function, the `$class` variable on line 458 stands
for either `nojq nojs` or `nojq nojs mobile`. Neither string would require
escaping.
>
> That's what I meant in comment:3. I don't see any value in escaping
something that cannot be altered by third parties :)
That used to be my thinking too, but @peterwilsoncc raised a good point in
comment:7:ticket:57133 that even though the values do not require escaping
currently, this may change in the future so it would be a good idea to
escape anything that is a variable. I've been following that approach
lately.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58251#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list