Make WordPress Core

Ticket #34826: 34826.diff

File 34826.diff, 978 bytes (added by swissspidy, 11 years ago)
  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index d96a2fb..5873445 100644
    function wp_ajax_send_attachment_to_editor() {  
    25702570        $rel = '';
    25712571        $url = empty( $attachment['url'] ) ? '' : $attachment['url'];
    25722572        if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url ) {
    2573                 $rel = ' rel="attachment wp-att-' . $id . '"';
     2573                $rel = 'attachment wp-att-' . $id;
    25742574        }
    25752575
    25762576        remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
    … … function wp_ajax_send_attachment_to_editor() {  
    25932593        } else {
    25942594                $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
    25952595                if ( ! empty( $url ) ) {
    2596                         $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
     2596                        $html = '<a href="' . esc_url( $url ) . '"' . 'rel="' . esc_attr( $rel ) . '">' . $html . '</a>';
    25972597                }
    25982598        }
    25992599