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/post-template.php

    r11173 r11204  
    6464 *
    6565 * The title before it is displayed will have the tags stripped and {@link
    66  * attr()} before it is passed to the user or displayed. The default
     66 * esc_attr()} before it is passed to the user or displayed. The default
    6767 * as with {@link the_title()}, is to display the title.
    6868 *
     
    8484
    8585    $title = $before . $title . $after;
    86     $title = attr(strip_tags($title));
     86    $title = esc_attr(strip_tags($title));
    8787
    8888    if ( $echo )
     
    708708            $output .= "\t<option value=\"-1\">$show_option_no_change</option>";
    709709        if ( $show_option_none )
    710             $output .= "\t<option value=\"" . attr($option_none_value) . "\">$show_option_none</option>\n";
     710            $output .= "\t<option value=\"" . esc_attr($option_none_value) . "\">$show_option_none</option>\n";
    711711        $output .= walk_page_dropdown_tree($pages, $depth, $r);
    712712        $output .= "</select>\n";
     
    928928        $url = get_attachment_link($_post->ID);
    929929
    930     $post_title = attr($_post->post_title);
     930    $post_title = esc_attr($_post->post_title);
    931931
    932932    if ( $text ) {
    933         $link_text = attr($text);
     933        $link_text = esc_attr($text);
    934934    } elseif ( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {
    935935        $link_text = wp_get_attachment_image($id, $size, $icon);
     
    965965        $url = get_attachment_link($_post->ID);
    966966
    967     $post_title = attr($_post->post_title);
     967    $post_title = esc_attr($_post->post_title);
    968968
    969969    $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
     
    10611061    }
    10621062
    1063     $post_title = attr($post->post_title);
     1063    $post_title = esc_attr($post->post_title);
    10641064
    10651065    $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";
     
    10891089
    10901090
    1091     $innerHTML = attr($post->post_title);
     1091    $innerHTML = esc_attr($post->post_title);
    10921092
    10931093    return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
     
    11351135    $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    11361136    <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
    1137     <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . _a("Submit") . '" /></p>
     1137    <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
    11381138    </form>
    11391139    ';
     
    13171317<div class="tablenav">
    13181318    <div class="alignleft">
    1319         <input type="submit" class="button-secondary" value="<?php _ea( 'Compare Revisions' ); ?>" />
     1319        <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Compare Revisions' ); ?>" />
    13201320        <input type="hidden" name="action" value="diff" />
    13211321    </div>
Note: See TracChangeset for help on using the changeset viewer.