diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index f6dd19c0b3..4ef13601e7 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -20,8 +20,8 @@ if ( $doaction ) { check_admin_referer( 'bulk-comments' ); if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) { - $comment_status = $_REQUEST['comment_status']; - $delete_time = $_REQUEST['pagegen_timestamp']; + $comment_status = wp_unslash( $_REQUEST['comment_status'] ); + $delete_time = wp_unslash ( $_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 ) ); $doaction = 'delete'; } elseif ( isset( $_REQUEST['delete_comments'] ) ) { diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 421c430689..644857f5eb 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1333,7 +1333,7 @@ function _draft_or_post_title( $post = 0 ) { * */ function _admin_search_query() { - echo isset($_REQUEST['s']) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : ''; + echo isset($_REQUEST['s']) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : ''; } /** diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index 5654f05e3c..5d5191b38a 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -50,8 +50,8 @@ function install_themes_feature_list() { * @since 2.8.0 */ function install_theme_search_form( $type_selector = true ) { - $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term'; - $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; + $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; + $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : ''; if ( ! $type_selector ) echo '
' . __( 'Search for themes by keyword.' ) . '
'; ?> @@ -179,7 +179,7 @@ add_action('install_themes_updated', 'display_themes'); function install_theme_information() { global $tab, $themes_allowedtags, $wp_list_table; - $theme = themes_api( 'theme_information', array( 'slug' => stripslashes( $_REQUEST['theme'] ) ) ); + $theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) ); if ( is_wp_error( $theme ) ) wp_die( $theme ); diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 9ef77e5ba0..531d21f9f7 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -132,7 +132,7 @@ function wp_install_defaults($user_id) { $first_post = get_site_option( 'first_post' ); if ( empty($first_post) ) - $first_post = stripslashes( __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' ) ); + $first_post = __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' ); $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post ); $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post ); @@ -636,23 +636,23 @@ function upgrade_160() { $users = $wpdb->get_results("SELECT * FROM $wpdb->users"); foreach ( $users as $user ) : if ( !empty( $user->user_firstname ) ) - update_user_meta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) ); + update_user_meta( $user->ID, 'first_name', wp_slash($user->user_firstname) ); if ( !empty( $user->user_lastname ) ) - update_user_meta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) ); + update_user_meta( $user->ID, 'last_name', wp_slash($user->user_lastname) ); if ( !empty( $user->user_nickname ) ) - update_user_meta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) ); + update_user_meta( $user->ID, 'nickname', wp_slash($user->user_nickname) ); if ( !empty( $user->user_level ) ) update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level ); if ( !empty( $user->user_icq ) ) - update_user_meta( $user->ID, 'icq', $wpdb->escape($user->user_icq) ); + update_user_meta( $user->ID, 'icq', wp_slash($user->user_icq) ); if ( !empty( $user->user_aim ) ) - update_user_meta( $user->ID, 'aim', $wpdb->escape($user->user_aim) ); + update_user_meta( $user->ID, 'aim', wp_slash($user->user_aim) ); if ( !empty( $user->user_msn ) ) - update_user_meta( $user->ID, 'msn', $wpdb->escape($user->user_msn) ); + update_user_meta( $user->ID, 'msn', wp_slash($user->user_msn) ); if ( !empty( $user->user_yim ) ) - update_user_meta( $user->ID, 'yim', $wpdb->escape($user->user_icq) ); + update_user_meta( $user->ID, 'yim', wp_slash($user->user_icq) ); if ( !empty( $user->user_description ) ) - update_user_meta( $user->ID, 'description', $wpdb->escape($user->user_description) ); + update_user_meta( $user->ID, 'description', wp_slash($user->user_description) ); if ( isset( $user->user_idmode ) ): $idmode = $user->user_idmode; @@ -854,7 +854,7 @@ function upgrade_230() { foreach ( $link_cats as $category) { $cat_id = (int) $category->cat_id; $term_id = 0; - $name = $wpdb->escape($category->cat_name); + $name = wp_slash($category->cat_name); $slug = sanitize_title($name); $term_group = 0; diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index ea3bdbf6a9..f3ec1e5bca 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -34,7 +34,7 @@ function edit_user( $user_id = 0 ) { $update = true; $user->ID = (int) $user_id; $userdata = get_userdata( $user_id ); - $user->user_login = $wpdb->escape( $userdata->user_login ); + $user->user_login = wp_slash( $userdata->user_login ); } else { $update = false; } diff --git a/wp-admin/install.php b/wp-admin/install.php index dd489af0cc..c8ade7323e 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -84,10 +84,10 @@ function display_setup_form( $error = null ) { if ( ! empty( $_POST ) ) $blog_public = isset( $_POST['blog_public'] ); - $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; - $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; - $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : ''; - $admin_email = isset( $_POST['admin_email'] ) ? trim( stripslashes( $_POST['admin_email'] ) ) : ''; + $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; + $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : 'admin'; + $admin_password = isset($_POST['admin_password']) ? trim( wp_unslash( $_POST['admin_password'] ) ) : ''; + $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; if ( ! is_null( $error ) ) { ?> @@ -189,11 +189,11 @@ switch($step) { display_header(); // Fill in the data we gathered - $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; - $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; - $admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : ''; - $admin_password_check = isset($_POST['admin_password2']) ? $_POST['admin_password2'] : ''; - $admin_email = isset( $_POST['admin_email'] ) ?trim( stripslashes( $_POST['admin_email'] ) ) : ''; + $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; + $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : 'admin'; + $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : ''; + $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : ''; + $admin_email = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : ''; $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; // check e-mail address $error = false; diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 92194f0392..3154f8e3db 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -31,7 +31,7 @@ if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { exit; } } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { - wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); + wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } @@ -72,7 +72,7 @@ if ( ! current_user_can('manage_links') )