Opened 10 years ago
Closed 10 years ago
#37457 closed defect (bug) (fixed)
Review usage of esc_attr_e()
| Reported by: | afercia | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | low | Milestone: | 4.7 |
| Component: | I18N | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch |
| Cc: | Focuses: |
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
@
10 years ago
Replying to SergeyBiryukov:
esc_url()is not available at that point, see [23455].
Apparently it is available since [28978] :)
#4
@
10 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
#5
@
10 years ago
- Keywords has-patch added; needs-patch removed
37457.diff fixes esc_attr_e() usage.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Previously: #23334.
esc_url()is not available at that point, see [23455].