use esc_url() for the term link href in get_the_taxonomies() - #13062
use esc_url() for the term link href in get_the_taxonomies()#13062nvxbug wants to merge 1 commit into
Conversation
Trac Ticket MissingThis pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @nvxbug. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Failing assertion when a
term_linkfilter returns ajavascript:URL:get_the_taxonomies()builds the termhrefwithesc_attr( get_term_link( $term ) ).esc_attr()does not apply the protocol allowlist, so a scheme injected through the publicterm_linkfilter reaches the anchor unchanged. The sibling renderersget_the_term_list()andget_the_category_list()already run the same value throughesc_url(); this bringsget_the_taxonomies()in line with them. Included a regression test that fails on the current code and passes with the change.Trac ticket: