#62952 closed defect (bug) (invalid)
Wrong Escaping functionality in ajax
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.7.2 |
Component: | General | Keywords: | has-screenshots |
Focuses: | javascript, administration, coding-standards, php-compatibility | Cc: |
Description
Wrong Escaping functionality ajax-actions.php file... missing Escaping functionality is esc_html( $url ).
File Location:- ...\wp-admin\includes\ajax-actions.php file line number 3822.
I have shared the screenshot below...
Attachments (1)
Change History (6)
#3
@
2 months ago
- Keywords has-patch changes-requested removed
Hi @rajdiptank111,
Thank you for bringing this up!
For this case, using esc_html()
is appropriate. The URL is being displayed inside a <code>
tag as part of an error message, not being used as an actual URL in a link or form action.
If this URL was being used in an href attribute or anywhere where an actual URL is required, then you would want to use esc_url()
. But since this is purely for display purposes inside a code tag in an error message, esc_html()
is the correct choice here.
Note: See
TracTickets for help on using
tickets.
Wrong Escaping functionality in ajax