WordPress.org

Make WordPress Core

Ticket #29696: 29696.patch

File 29696.patch, 560 bytes (added by joemcgill, 6 years ago)

Filter user_nicename before updating the database.

  • src/wp-includes/user.php

     
    16791679        if ( empty( $userdata['user_nicename'] ) ) {
    16801680                $user_nicename = sanitize_title( $user_login );
    16811681        } else {
    1682                 $user_nicename = $userdata['user_nicename'];
     1682                $sanitized_user_nicename = sanitize_user( $userdata['user_nicename'], true );
     1683                $user_nicename = sanitize_title( $sanitized_user_nicename );
    16831684        }
    16841685
    16851686        // Store values to save in user meta.