Make WordPress Core

Ticket #36084: 36084.2.diff

File 36084.2.diff, 1.3 KB (added by joemcgill, 10 years ago)
  • src/wp-admin/includes/media.php

    diff --git src/wp-admin/includes/media.php src/wp-admin/includes/media.php
    index d9dd1e6..5b04b7c0 100644
    function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re 
    121121
    122122        $html = get_image_tag($id, $alt, '', $align, $size);
    123123
    124         if ( ! $rel ) {
    125                 $rel = ' rel="attachment wp-att-' . esc_attr( $id ) . '"';
    126         } else {
    127                 $rel = ' rel="' . esc_attr( $rel ) . '"';
    128         }
     124        $rel = $rel ? ' rel="' . esc_attr( $rel ) . '"' :  '';
    129125
    130126        if ( $url )
    131127                $html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
    function image_media_send_to_editor($html, $attachment_id, $attachment) { 
    11661162                $align = !empty($attachment['align']) ? $attachment['align'] : 'none';
    11671163                $size = !empty($attachment['image-size']) ? $attachment['image-size'] : 'medium';
    11681164                $alt = !empty($attachment['image_alt']) ? $attachment['image_alt'] : '';
    1169                 $rel = ( $url == get_attachment_link($attachment_id) );
     1165                $rel = '';
     1166                if ( strpos( $url, 'attachment_id') || $url == get_attachment_link($attachment_id) ) {
     1167                        $rel = 'attachment wp-att-' . $id;
     1168                }
    11701169
    11711170                return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt);
    11721171        }