Make WordPress Core


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

Security: Backport the WordPress 7.0.3 security fixes to the 5.9 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.
  • Editor: Fix output for post date.

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

Props xknown, westonruter, jeremyfelt, peterwilsoncc, paulkevan, lucasbustamante, jorbin, desrosj, vortfu, dmsnell, johnbillion, ehtis, batmoo, lancewillett, jonsurrell, isabel_brison, bernhard-reiter, tyxla, aduth.

File:
1 edited

Legend:

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

    r54544 r63100  
    153153                                /* translators: %s: User name. */
    154154                                __( '<strong>Error</strong>: The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ),
    155                                 $username
     155                                esc_html( $username )
    156156                        )
    157157                );
    … …  
    178178                                /* translators: %s: User name. */
    179179                                __( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ),
    180                                 '<strong>' . $username . '</strong>'
     180                                '<strong>' . esc_html( $username ) . '</strong>'
    181181                        ) .
    182182                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    250250                                /* translators: %s: Email address. */
    251251                                __( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ),
    252                                 '<strong>' . $email . '</strong>'
     252                                '<strong>' . esc_html( $email ) . '</strong>'
    253253                        ) .
    254254                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    33143314                                /* translators: %s: Link to the login page. */
    33153315                                __( '<strong>Error:</strong> This email address is already registered. <a href="%s">Log in</a> with this address or choose another one.' ),
    3316                                 wp_login_url()
     3316                                esc_url( wp_login_url() )
    33173317                        )
    33183318                );
    … …  
    33623362                                /* translators: %s: Admin email address. */
    33633363                                __( '<strong>Error</strong>: Could not register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
    3364                                 get_option( 'admin_email' )
     3364                                esc_attr( get_option( 'admin_email' ) )
    33653365                        )
    33663366                );
    … …  
    35853585 * @since 3.0.0
    35863586 * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.
     3587 * @since 7.0.3 Added the `$user_id` parameter, which is sent with the `personal_options_update` action.
     3588 *
     3589 * @param int $user_id Optional. The ID of the user whose email is being changed. Defaults to `$_POST['user_id']` if set, otherwise 0.
    35873590 *
    35883591 * @global WP_Error $errors WP_Error object.
    35893592 */
    3590 function send_confirmation_on_profile_email() {
     3593function send_confirmation_on_profile_email( $user_id = 0 ) {
    35913594        global $errors;
     3595
     3596        // Maintain backward compatibility for those relying on a check based on $_POST['user_id'].
     3597        if ( ! $user_id && isset( $_POST['user_id'] ) ) {
     3598                $user_id = (int) $_POST['user_id'];
     3599        }
    35923600
    35933601        $current_user = wp_get_current_user();
    … …  
    35963604        }
    35973605
    3598         if ( $current_user->ID != $_POST['user_id'] ) {
     3606        if ( 0 === $current_user->ID || $current_user->ID !== (int) $user_id ) {
    35993607                return false;
    36003608        }
    … …  
    36103618                        );
    36113619
     3620                        $_POST['email'] = addslashes( $current_user->user_email );
    36123621                        return;
    36133622                }
    … …  
    36233632                        delete_user_meta( $current_user->ID, '_new_email' );
    36243633
     3634                        $_POST['email'] = addslashes( $current_user->user_email );
    36253635                        return;
    36263636                }
Note: See TracChangeset for help on using the changeset viewer.