Skip to content

Commit

Permalink
Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are…
Browse files Browse the repository at this point in the history
… going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767

git-svn-id: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
Ryan Boren committed Mar 1, 2013
1 parent 0bb4718 commit 43a7e69
Show file tree
Hide file tree
Showing 89 changed files with 658 additions and 534 deletions.
4 changes: 2 additions & 2 deletions wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
do_action('after_db_upgrade');
} elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) {
if ( !is_multisite() ) {
wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
exit;
} elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
/**
Expand Down Expand Up @@ -82,7 +82,7 @@
$editing = false;

if ( isset($_GET['page']) ) {
$plugin_page = wp_unslash( $_GET['page'] );
$plugin_page = stripslashes($_GET['page']);
$plugin_page = plugin_basename($plugin_page);
}

Expand Down
4 changes: 2 additions & 2 deletions wp-admin/custom-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function handle_upload() {

// Add the meta-data
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
wp_update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );

set_theme_mod('background_image', esc_url_raw($url));

Expand Down Expand Up @@ -415,7 +415,7 @@ public function wp_set_background_image() {
if ( in_array( $_POST['size'], $sizes ) )
$size = esc_attr( $_POST['size'] );

wp_update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
$url = wp_get_attachment_image_src( $attachment_id, $size );
$thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ final public function set_header_image( $choice ) {
'width' => $choice['width'],
);

wp_update_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );
update_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );
set_theme_mod( 'header_image', $choice['url'] );
set_theme_mod( 'header_image_data', $header_image_data );
return;
Expand Down
10 changes: 5 additions & 5 deletions wp-admin/edit-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
check_admin_referer( 'bulk-comments' );

if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
$comment_status = $_REQUEST['comment_status'];
$delete_time = $_REQUEST['pagegen_timestamp'];
$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
$comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
$delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
$doaction = 'delete';
} elseif ( isset( $_REQUEST['delete_comments'] ) ) {
$comment_ids = $_REQUEST['delete_comments'];
Expand Down Expand Up @@ -95,7 +95,7 @@
wp_safe_redirect( $redirect_to );
exit;
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}

Expand Down Expand Up @@ -153,7 +153,7 @@
echo __('Comments');

if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
</h2>

<?php
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit-form-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url( wp_get_referer() ); ?>" />
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( ! empty( $active_post_lock ) ) { ?>
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
<?php
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit-form-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
<input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url( wp_get_referer() ); ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php wp_original_referer_field(true, 'previous'); ?>
<input type="hidden" name="noredir" value="1" />

Expand Down
1 change: 1 addition & 0 deletions wp-admin/edit-link-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<?php else: ?>
<input type="hidden" name="action" value="add" />
Expand Down
17 changes: 6 additions & 11 deletions wp-admin/edit-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
if ( !current_user_can( $tax->cap->edit_terms ) )
wp_die( __( 'Cheatin&#8217; uh?' ) );

$post_data = wp_unslash( $_POST );

$ret = wp_insert_term( $post_data['tag-name'], $taxonomy, $post_data );
$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
if ( 'post' != $post_type )
$location .= '&post_type=' . $post_type;
Expand Down Expand Up @@ -134,10 +132,7 @@
break;

case 'editedtag':

$post_data = wp_unslash( $_POST );

$tag_ID = (int) $post_data['tag_ID'];
$tag_ID = (int) $_POST['tag_ID'];
check_admin_referer( 'update-tag_' . $tag_ID );

if ( !current_user_can( $tax->cap->edit_terms ) )
Expand All @@ -147,7 +142,7 @@
if ( ! $tag )
wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );

$ret = wp_update_term( $tag_ID, $taxonomy, $post_data );
$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );

$location = 'edit-tags.php?taxonomy=' . $taxonomy;
if ( 'post' != $post_type )
Expand All @@ -169,7 +164,7 @@

default:
if ( ! empty($_REQUEST['_wp_http_referer']) ) {
$location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) );
$location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );

if ( ! empty( $_REQUEST['paged'] ) )
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
Expand Down Expand Up @@ -269,8 +264,8 @@
<div class="wrap nosubsub">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title );
if ( ! empty($_REQUEST['s']) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); ?>
if ( !empty($_REQUEST['s']) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2>

<?php if ( isset($_REQUEST['message']) && ( $msg = (int) $_REQUEST['message'] ) ) : ?>
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
wp_redirect($sendback);
exit();
} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit;
}

Expand Down
Loading

0 comments on commit 43a7e69

Please sign in to comment.