[wp-trac] [WordPress Trac] #46421: rel="noopener noreferrer" should be added to links with target="_blank" which are in text and HTML widgets
WordPress Trac
noreply at wordpress.org
Tue Mar 19 10:57:22 UTC 2019
#46421: rel="noopener noreferrer" should be added to links with target="_blank"
which are in text and HTML widgets
--------------------------------------------------+-----------------------
Reporter: mark-k | Owner: audrasjb
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 5.2
Component: Widgets | Version: 5.1
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion has-unit-tests | Focuses:
--------------------------------------------------+-----------------------
Changes (by birgire):
* keywords: has-patch 2nd-opinion => has-patch 2nd-opinion has-unit-tests
Comment:
[attachment:"46421-2.diff"] adds the following test cases:
- Ensure that {{{rel="noopener noreferrer"}}} is added to links with a
target in the output of the ''Text'' widget.
- Ensure these relationships are __not__ added to links without a target
in the output of the ''Text'' widget.
- Ensure that {{{rel="noopener noreferrer"}}} is added to links with a
target in the output of the ''Custom HTML'' widget.
- Ensure these relationships are __not__ added to links without a target
in the output of the ''Custom HTML'' widget.
@mukesh27 I guess you mean to make it clear that adding these
relationships, is not causing any duplication.
I modified your suggestion to:
{{{
// Adds noreferrer and noopener relationships, without duplicating values,
to all HTML A elements that have a target.
}}}
in [attachment:"46421-2.diff"].
What do you think about this modified inline comment version?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46421#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list