[wp-trac] [WordPress Trac] #36578: wp_ajax_send_attachment_to_editor() bug
WordPress Trac
noreply at wordpress.org
Mon Apr 18 16:57:03 UTC 2016
#36578: wp_ajax_send_attachment_to_editor() bug
--------------------------+-----------------------------
Reporter: otterstein | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.5
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
there is a problem at wp_ajax_send_attachment_to_editor()
in the file ajax-actions.php in wp-admin/includes/
on line 2605
the link to editor comes with <a href="mediafile"">mediafile</a>
i fixed the file with:
Old one
{{{
$html = isset( $attachment['post_title'] ) ? $attachment['post_title'] :
'';
$rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : '';
// Hard-coded string, $id is already sanitized
if ( ! empty( $url ) ) {
$html = '<a href="' . esc_url( $url ) . '"' . $rel
. '">' . $html . '</a>';
}
}}}
into new one
{{{
$rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : ''; // Hard-coded
string, $id is already sanitized
if ( ! empty( $url ) ) {
$html = '<a href="' . esc_url( $url ) . '"' . $rel
. '>' . $html . '</a>';
}
}}}
the " before the '>' . $html was a doublicate
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36578>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list