Opened 8 years ago
Closed 8 years ago
#37457 closed defect (bug) (fixed)
Review usage of esc_attr_e()
Reported by: | afercia | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.7 | Priority: | low |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
Spotted a few places where esc_attr_e()
is probably used not correctly, maybe worth double checking if there are more places:
Here it should probably be echo esc_url()
and the URL should be translatable as done in other similar cases:
setup-config.php <p id="logo"><a href="<?php esc_attr_e( 'https://wordpress.org/' ); ?>" ...
In the following cases the string are used for plain HTML text, they're not attributes:
revision.php ... <?php esc_attr_e( 'Compare any two revisions' ); ?> </label> comment.php ... <?php esc_attr_e( 'Edit' ); ?></a> ... <?php esc_attr_e( 'Cancel' ); ?></a>
Attachments (1)
Change History (10)
#3
in reply to:
↑ 2
@
8 years ago
Replying to SergeyBiryukov:
esc_url()
is not available at that point, see [23455].
Apparently it is available since [28978] :)
#4
@
8 years ago
I've been through the codebase and found the following places where esc_attr_e()
is used incorrectly:
- wp-includes/media-template.php
- wp-admin/includes/revision.php
- wp-admin/comment.php
- wp-login.php
- wp-admin/theme-editor.php - Just need to remove white space
- wp-admin/setup-config.php
Note: See
TracTickets for help on using
tickets.
Previously: #23334.
esc_url()
is not available at that point, see [23455].