Skip to content

Commit fe7c34b

Browse files
committed
s/attribute_escape/attr/. see WordPress#9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11109 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6c066a9 commit fe7c34b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+391
-391
lines changed

wp-admin/admin-ajax.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ function _wp_ajax_delete_comment_response( $comment_id ) {
474474
$cat_full_name = $_cat->name . ' — ' . $cat_full_name;
475475
$level++;
476476
}
477-
$cat_full_name = attribute_escape($cat_full_name);
477+
$cat_full_name = attr($cat_full_name);
478478

479479
$x = new WP_Ajax_Response( array(
480480
'what' => 'cat',
@@ -552,7 +552,7 @@ function _wp_ajax_delete_comment_response( $comment_id ) {
552552
die('0');
553553

554554
$tag_full_name = $tag->name;
555-
$tag_full_name = attribute_escape($tag_full_name);
555+
$tag_full_name = attr($tag_full_name);
556556

557557
$x = new WP_Ajax_Response( array(
558558
'what' => 'tag',

wp-admin/custom-header.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function step_1() {
287287
<input type="button" class="button" value="<?php _ea('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
288288
<input type="button" class="button" value="<?php _ea('Select a Text Color'); ?>" id="pickcolor" /><input type="button" class="button" value="<?php _ea('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
289289
<?php wp_nonce_field('custom-header') ?>
290-
<input type="hidden" name="textcolor" id="textcolor" value="#<?php attribute_escape(header_textcolor()) ?>" /><input name="submit" type="submit" class="button" value="<?php _ea('Save Changes'); ?>" /></form>
290+
<input type="hidden" name="textcolor" id="textcolor" value="#<?php attr(header_textcolor()) ?>" /><input name="submit" type="submit" class="button" value="<?php _ea('Save Changes'); ?>" /></form>
291291
<?php } ?>
292292

293293
<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"> </div>
@@ -296,7 +296,7 @@ function step_1() {
296296
<h2><?php _e('Upload New Header Image'); ?></h2><p><?php _e('Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.'); ?></p>
297297
<p><?php printf(__('Images of exactly <strong>%1$d x %2$d pixels</strong> will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?></p>
298298

299-
<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo attribute_escape(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
299+
<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo attr(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
300300
<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
301301
<input type="hidden" name="action" value="save" />
302302
<?php wp_nonce_field('custom-header') ?>
@@ -311,7 +311,7 @@ function step_1() {
311311
<div class="wrap">
312312
<h2><?php _e('Reset Header Image and Color'); ?></h2>
313313
<p><?php _e('This will restore the original header image and color. You will not be able to retrieve any customizations.') ?></p>
314-
<form method="post" action="<?php echo attribute_escape(add_query_arg('step', 1)) ?>">
314+
<form method="post" action="<?php echo attr(add_query_arg('step', 1)) ?>">
315315
<?php wp_nonce_field('custom-header'); ?>
316316
<input type="submit" class="button" name="resetheader" value="<?php _ea('Restore Original Header'); ?>" />
317317
</form>
@@ -372,7 +372,7 @@ function step_2() {
372372

373373
<div class="wrap">
374374

375-
<form method="POST" action="<?php echo attribute_escape(add_query_arg('step', 3)) ?>">
375+
<form method="POST" action="<?php echo attr(add_query_arg('step', 3)) ?>">
376376

377377
<p><?php _e('Choose the part of the image you want to use as your header.'); ?></p>
378378
<div id="testWrap" style="position: relative">

wp-admin/edit-attachment-rows.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
6363
?>
6464

65-
<a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>">
65+
<a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attr(sprintf(__('Edit "%s"'), $att_title)); ?>">
6666
<?php echo $thumb; ?>
6767
</a>
6868

@@ -74,7 +74,7 @@
7474

7575
case 'media':
7676
?>
77-
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
77+
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attr(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
7878
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
7979
<p>
8080
<?php
@@ -83,7 +83,7 @@
8383
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
8484
if ( current_user_can('delete_post', $post->ID) )
8585
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
86-
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
86+
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attr(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
8787
$action_count = count($actions);
8888
$i = 0;
8989
echo '<div class="row-actions">';
@@ -182,7 +182,7 @@
182182
case 'actions':
183183
?>
184184
<td <?php echo $attributes ?>>
185-
<a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
185+
<a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attr(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
186186
<a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a>
187187
</td>
188188
<?php

wp-admin/edit-category-form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ function _fill_empty_category(&$category) {
4949
<table class="form-table">
5050
<tr class="form-field form-required">
5151
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
52-
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
52+
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attr($category->name); ?>" size="40" aria-required="true" /><br />
5353
<?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
5454
</tr>
5555
<tr class="form-field">
5656
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
57-
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
57+
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
5858
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
5959
</tr>
6060
<tr class="form-field">

wp-admin/edit-comments.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
require_once('admin-header.php');
8585

86-
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']);
86+
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attr($_GET['mode']);
8787

8888
$default_status = get_user_option('edit_comments_last_view');
8989
if ( empty($default_status) )
@@ -94,10 +94,10 @@
9494
if ( $comment_status != $default_status )
9595
update_usermeta($current_user->ID, 'edit_comments_last_view', $comment_status);
9696

97-
$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : '';
97+
$comment_type = !empty($_GET['comment_type']) ? attr($_GET['comment_type']) : '';
9898

9999
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
100-
$search = attribute_escape( $search_dirty ); ?>
100+
$search = attr( $search_dirty ); ?>
101101

102102
<div class="wrap">
103103
<?php screen_icon(); ?>
@@ -164,7 +164,7 @@
164164
/*
165165
// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
166166
if ( !empty( $_GET['s'] ) )
167-
$link = add_query_arg( 's', attribute_escape( stripslashes( $_GET['s'] ) ), $link );
167+
$link = add_query_arg( 's', attr( stripslashes( $_GET['s'] ) ), $link );
168168
*/
169169
$status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
170170
_n( $label[0], $label[1], $num_comments->$status ),
@@ -364,8 +364,8 @@
364364
<input type="hidden" name="mode" value="<?php echo attr($mode); ?>" />
365365
<input type="hidden" name="comment_status" value="<?php echo attr($comment_status); ?>" />
366366
<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
367-
<input type="hidden" name="p" value="<?php echo attribute_escape( $post_id ); ?>" />
368-
<input type="hidden" name="comment_type" value="<?php echo attribute_escape( $comment_type ); ?>" />
367+
<input type="hidden" name="p" value="<?php echo attr( $post_id ); ?>" />
368+
<input type="hidden" name="comment_type" value="<?php echo attr( $comment_type ); ?>" />
369369
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
370370
</form>
371371

wp-admin/edit-form-advanced.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$action = isset($action) ? $action : '';
1717
if ( isset($_GET['message']) )
1818
$_GET['message'] = absint( $_GET['message'] );
19-
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
19+
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attr( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
2020
$messages[2] = __('Custom field updated.');
2121
$messages[3] = __('Custom field deleted.');
2222
$messages[4] = __('Post updated.');
@@ -169,15 +169,15 @@ function post_submit_meta_box($post) {
169169
?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
170170

171171
<div id="post-visibility-select" class="hide-if-js">
172-
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
172+
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attr($post->post_password); ?>" />
173173
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
174-
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
174+
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attr( $visibility ); ?>" />
175175

176176

177177
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
178178
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
179179
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
180-
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
180+
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attr($post->post_password); ?>" /><br /></span>
181181
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
182182

183183
<p>
@@ -271,7 +271,7 @@ function post_submit_meta_box($post) {
271271
function post_tags_meta_box($post, $box) {
272272
$tax_name = substr($box['id'], 8);
273273
$taxonomy = get_taxonomy($tax_name);
274-
$helps = isset($taxonomy->helps) ? attribute_escape($taxonomy->helps) : __('Separate tags with commas.');
274+
$helps = isset($taxonomy->helps) ? attr($taxonomy->helps) : __('Separate tags with commas.');
275275
?>
276276
<div class="tagsdiv" id="<?php echo $tax_name; ?>">
277277
<p class="jaxtag">
@@ -293,7 +293,7 @@ function post_tags_meta_box($post, $box) {
293293
foreach ( get_object_taxonomies('post') as $tax_name ) {
294294
if ( !is_taxonomy_hierarchical($tax_name) ) {
295295
$taxonomy = get_taxonomy($tax_name);
296-
$label = isset($taxonomy->label) ? attribute_escape($taxonomy->label) : $tax_name;
296+
$label = isset($taxonomy->label) ? attr($taxonomy->label) : $tax_name;
297297

298298
add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core');
299299
}
@@ -384,7 +384,7 @@ function post_excerpt_meta_box($post) {
384384
* @param object $post
385385
*/
386386
function post_trackback_meta_box($post) {
387-
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
387+
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
388388
if ('' != $post->pinged) {
389389
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
390390
$already_pinged = explode("\n", trim($post->pinged));
@@ -497,7 +497,7 @@ function post_comment_meta_box($post) {
497497
*/
498498
function post_slug_meta_box($post) {
499499
?>
500-
<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
500+
<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attr( $post->post_name ); ?>" />
501501
<?php
502502
}
503503
if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
@@ -574,7 +574,7 @@ function post_revisions_meta_box($post) {
574574
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
575575
<input type="hidden" id="hiddenaction" name="action" value="<?php echo attr($form_action) ?>" />
576576
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo attr($form_action) ?>" />
577-
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
577+
<input type="hidden" id="post_author" name="post_author" value="<?php echo attr( $post->post_author ); ?>" />
578578
<input type="hidden" id="post_type" name="post_type" value="<?php echo attr($post->post_type) ?>" />
579579
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo attr($post->post_status) ?>" />
580580
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
@@ -595,7 +595,7 @@ function post_revisions_meta_box($post) {
595595
<div id="post-body-content">
596596
<div id="titlediv">
597597
<div id="titlewrap">
598-
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
598+
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
599599
</div>
600600
<div class="inside">
601601
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>

wp-admin/edit-form-comment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
2727
<?php
2828

29-
$email = attribute_escape( $comment->comment_author_email );
30-
$url = attribute_escape( $comment->comment_author_url );
29+
$email = attr( $comment->comment_author_email );
30+
$url = attr( $comment->comment_author_url );
3131
// add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
3232
?>
3333

@@ -90,7 +90,7 @@
9090
<tbody>
9191
<tr valign="top">
9292
<td class="first"><?php _e( 'Name:' ); ?></td>
93-
<td><input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
93+
<td><input type="text" name="newcomment_author" size="30" value="<?php echo attr( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
9494
</tr>
9595
<tr valign="top">
9696
<td class="first">

wp-admin/edit-link-category-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function _fill_empty_link_category(&$category) {
6767
</tr>
6868
<tr class="form-field">
6969
<th scope="row" valign="top"><label for="slug"><?php _e('Link Category slug') ?></label></th>
70-
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
70+
<td><input name="slug" id="slug" type="text" value="<?php echo attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
7171
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
7272
</tr>
7373
<tr class="form-field">

wp-admin/edit-link-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ function link_advanced_meta_box($link) {
404404
if ( $link_id ) : ?>
405405
<input type="hidden" name="action" value="save" />
406406
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
407-
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
407+
<input type="hidden" name="order_by" value="<?php echo attr($order_by); ?>" />
408408
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
409409
<?php else: ?>
410410
<input type="hidden" name="action" value="add" />

0 commit comments

Comments
 (0)