Changeset 11204 for trunk/wp-includes/general-template.php
- Timestamp:
- 05/05/2009 07:43:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r11190 r11204 121 121 $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" > 122 122 <div><label class="invisible" for="s">' . __('Search for:') . '</label> 123 <input type="text" value="' . attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />124 <input type="submit" id="searchsubmit" value="'. _a('Search') .'" />123 <input type="text" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> 124 <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> 125 125 </div> 126 126 </form>'; … … 689 689 function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { 690 690 $text = wptexturize($text); 691 $title_text = attr($text);691 $title_text = esc_attr($text); 692 692 $url = clean_url($url); 693 693 … … 1435 1435 $args = wp_parse_args( $args, $defaults ); 1436 1436 1437 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attr(sprintf( $args['feedtitle'], get_bloginfo('name') )) . '" href="' . get_feed_link() . "\" />\n";1438 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attr(sprintf( $args['comstitle'], get_bloginfo('name') )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";1437 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['feedtitle'], get_bloginfo('name') )) . '" href="' . get_feed_link() . "\" />\n"; 1438 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['comstitle'], get_bloginfo('name') )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n"; 1439 1439 } 1440 1440 … … 1468 1468 1469 1469 if ( comments_open() || pings_open() || $post->comment_count > 0 ) { 1470 $title = attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], wp_specialchars( get_the_title() ) ));1470 $title = esc_attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], wp_specialchars( get_the_title() ) )); 1471 1471 $href = get_post_comments_feed_link( $post->ID ); 1472 1472 } … … 1474 1474 $cat_id = intval( get_query_var('cat') ); 1475 1475 1476 $title = attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));1476 $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) )); 1477 1477 $href = get_category_feed_link( $cat_id ); 1478 1478 } elseif ( is_tag() ) { … … 1480 1480 $tag = get_tag( $tag_id ); 1481 1481 1482 $title = attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));1482 $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name )); 1483 1483 $href = get_tag_feed_link( $tag_id ); 1484 1484 } elseif ( is_author() ) { 1485 1485 $author_id = intval( get_query_var('author') ); 1486 1486 1487 $title = attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) ));1487 $title = esc_attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) )); 1488 1488 $href = get_author_feed_link( $author_id ); 1489 1489 } elseif ( is_search() ) { 1490 $title = attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() ));1490 $title = esc_attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() )); 1491 1491 $href = get_search_feed_link(); 1492 1492 } … … 1682 1682 * Display the contents of the search query variable. 1683 1683 * 1684 * The search query string is passed through {@link attr()}1684 * The search query string is passed through {@link esc_attr()} 1685 1685 * to ensure that it is safe for placing in an html attribute. 1686 1686 * … … 1689 1689 */ 1690 1690 function the_search_query() { 1691 echo attr( apply_filters( 'the_search_query', get_search_query() ) );1691 echo esc_attr( apply_filters( 'the_search_query', get_search_query() ) ); 1692 1692 } 1693 1693
Note: See TracChangeset
for help on using the changeset viewer.