Make WordPress Core


Ignore:
Timestamp:
05/05/2009 07:43:53 PM (16 years ago)
Author:
markjaquith
Message:

_a(), _ea(), _xa(), attr() are now esc_attr(), esc_attr_e(), esc_attr_x(), esc_attr() -- still short, but less cryptic. see #9650

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r11200 r11204  
    201201    $hwstring = image_hwstring($width, $height);
    202202
    203     $class = 'align'.attr($align).' size-'.attr($size).' wp-image-'.$id;
     203    $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
    204204    $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
    205205
    206     $html = '<img src="'.attr($img_src).'" alt="'.attr($alt).'" title="'.attr($title).'" '.$hwstring.'class="'.$class.'" />';
     206    $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" />';
    207207
    208208    $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
     
    543543            );
    544544        $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );
    545         $attr = array_map( 'attr', $attr );
     545        $attr = array_map( 'esc_attr', $attr );
    546546        $html = rtrim("<img $hwstring");
    547547        foreach ( $attr as $name => $value ) {
Note: See TracChangeset for help on using the changeset viewer.