Make WordPress Core


Ignore:
Timestamp:
08/06/2026 07:53:19 PM (7 weeks ago)
Author:
desrosj
Message:

Security: Backport the WordPress 7.0.3 security fixes to the 5.1 branch.

  • Users: Ensure a proper email address is used before sending email confirmations.
  • Formatting: Prevent stack overflow in safecss_filter_attr.
  • Multisite: Enforce the active signup policy for existing users.
  • HTTP API: Improve compliance with IPv4 Special-Purpose Address Space.
  • Users: Prevent Usernames from mangling HTML
  • Canonical: Only redirect for publicly viewable post types.
  • Administration: When wp_is_large_user_count(), ensure that the post author is always added to author dropdown.

Merges [63060],[63061],[63062],[63063],[63064],[63065],[63067] to the 5.1 branch.

Props xknown, westonruter, jeremyfelt, peterwilsoncc, paulkevan, lucasbustamante, jorbin, desrosj, vortfu, dmsnell, johnbillion, ehtis, batmoo, lancewillett, jonsurrell.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.1/src/wp-includes/user.php

    r47646 r63111  
    181181                                /* translators: %s: user name */
    182182                                __( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ),
    183                                 '<strong>' . $username . '</strong>'
     183                                '<strong>' . esc_html( $username ) . '</strong>'
    184184                        ) .
    185185                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    255255                                /* translators: %s: email address */
    256256                                __( '<strong>ERROR</strong>: The password you entered for the email address %s is incorrect.' ),
    257                                 '<strong>' . $email . '</strong>'
     257                                '<strong>' . esc_html( $email ) . '</strong>'
    258258                        ) .
    259259                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    25032503        $user_id   = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    25042504        if ( ! $user_id || is_wp_error( $user_id ) ) {
    2505                 $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
     2505                $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ), esc_attr( get_option( 'admin_email' ) ) ) );
    25062506                return $errors;
    25072507        }
    … …  
    27162716 * @since 3.0.0
    27172717 * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.
     2718 * @since 7.0.3 Added the `$user_id` parameter, which is sent with the `personal_options_update` action.
     2719 *
     2720 * @param int $user_id Optional. The ID of the user whose email is being changed. Defaults to `$_POST['user_id']` if set, otherwise 0.
    27182721 *
    27192722 * @global WP_Error $errors WP_Error object.
    27202723 */
    2721 function send_confirmation_on_profile_email() {
     2724function send_confirmation_on_profile_email( $user_id = 0 ) {
    27222725        global $errors;
     2726
     2727        // Maintain backward compatibility for those relying on a check based on $_POST['user_id'].
     2728        if ( ! $user_id && isset( $_POST['user_id'] ) ) {
     2729                $user_id = (int) $_POST['user_id'];
     2730        }
    27232731
    27242732        $current_user = wp_get_current_user();
    … …  
    27272735        }
    27282736
    2729         if ( $current_user->ID != $_POST['user_id'] ) {
     2737        if ( 0 === $current_user->ID || $current_user->ID !== (int) $user_id ) {
    27302738                return false;
    27312739        }
    … …  
    27412749                        );
    27422750
     2751                        $_POST['email'] = addslashes( $current_user->user_email );
    27432752                        return;
    27442753                }
    … …  
    27542763                        delete_user_meta( $current_user->ID, '_new_email' );
    27552764
     2765                        $_POST['email'] = addslashes( $current_user->user_email );
    27562766                        return;
    27572767                }
Note: See TracChangeset for help on using the changeset viewer.