Make WordPress Core

Ticket #21221: 21221.2.diff

File 21221.2.diff, 1.3 KB (added by brianhogg, 10 years ago)

patch refresh

  • wp-includes/media.php

     
    306306        list( $img_src, $width, $height ) = image_downsize($id, $size);
    307307        $hwstring = image_hwstring($width, $height);
    308308
    309         $title = $title ? 'title="' . esc_attr( $title ) . '" ' : '';
     309        $title = $title ? 'title="' . esc_attr( wptexturize( $title ) ) . '" ' : '';
    310310
    311311        $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
    312312
     
    322322         */
    323323        $class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
    324324
    325         $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
     325        $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr( wptexturize( $alt ) ) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
    326326
    327327        /**
    328328         * Filter the HTML content for the image tag.
     
    711711                        $default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
    712712                if ( empty($default_attr['alt']) )
    713713                        $default_attr['alt'] = trim(strip_tags( $attachment->post_title )); // Finally, use the title
     714                $default_attr['alt'] = wptexturize( $default_attr['alt'] );
    714715
    715716                $attr = wp_parse_args($attr, $default_attr);
    716717