mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
s/attribute_escape/attr/. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11109 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -120,8 +120,8 @@ function get_search_form() {
|
||||
|
||||
$form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >
|
||||
<div><label class="hidden" for="s">' . __('Search for:') . '</label>
|
||||
<input type="text" value="' . attribute_escape(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />
|
||||
<input type="submit" id="searchsubmit" value="'.attribute_escape(__('Search')).'" />
|
||||
<input type="text" value="' . attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />
|
||||
<input type="submit" id="searchsubmit" value="'.attr(__('Search')).'" />
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
@@ -688,7 +688,7 @@ function single_month_title($prefix = '', $display = true ) {
|
||||
*/
|
||||
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
|
||||
$text = wptexturize($text);
|
||||
$title_text = attribute_escape($text);
|
||||
$title_text = attr($text);
|
||||
$url = clean_url($url);
|
||||
|
||||
if ('link' == $format)
|
||||
@@ -1434,8 +1434,8 @@ function feed_links( $args ) {
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['feedtitle'], get_bloginfo('name') )) . '" href="' . get_feed_link() . "\" />\n";
|
||||
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['comstitle'], get_bloginfo('name') )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";
|
||||
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attr(sprintf( $args['feedtitle'], get_bloginfo('name') )) . '" href="' . get_feed_link() . "\" />\n";
|
||||
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";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1467,27 +1467,27 @@ function feed_links_extra( $args ) {
|
||||
$post = &get_post( $id = 0 );
|
||||
|
||||
if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
|
||||
$title = attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], wp_specialchars( get_the_title() ) ));
|
||||
$title = attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], wp_specialchars( get_the_title() ) ));
|
||||
$href = get_post_comments_feed_link( $post->ID );
|
||||
}
|
||||
} elseif ( is_category() ) {
|
||||
$cat_id = intval( get_query_var('cat') );
|
||||
|
||||
$title = attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));
|
||||
$title = attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));
|
||||
$href = get_category_feed_link( $cat_id );
|
||||
} elseif ( is_tag() ) {
|
||||
$tag_id = intval( get_query_var('tag_id') );
|
||||
$tag = get_tag( $tag_id );
|
||||
|
||||
$title = attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));
|
||||
$title = attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));
|
||||
$href = get_tag_feed_link( $tag_id );
|
||||
} elseif ( is_author() ) {
|
||||
$author_id = intval( get_query_var('author') );
|
||||
|
||||
$title = attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) ));
|
||||
$title = attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) ));
|
||||
$href = get_author_feed_link( $author_id );
|
||||
} elseif ( is_search() ) {
|
||||
$title = attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() ));
|
||||
$title = attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() ));
|
||||
$href = get_search_feed_link();
|
||||
}
|
||||
|
||||
@@ -1678,14 +1678,14 @@ function get_search_query() {
|
||||
/**
|
||||
* Display the contents of the search query variable.
|
||||
*
|
||||
* The search query string is passed through {@link attribute_escape()}
|
||||
* The search query string is passed through {@link attr()}
|
||||
* to ensure that it is safe for placing in an html attribute.
|
||||
*
|
||||
* @uses attribute_escape
|
||||
* @uses attr
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function the_search_query() {
|
||||
echo attribute_escape( apply_filters( 'the_search_query', get_search_query() ) );
|
||||
echo attr( apply_filters( 'the_search_query', get_search_query() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user