WordPress.org

Make WordPress Core

Ticket #11746: 11746.diff

File 11746.diff, 2.7 KB (added by ryan, 8 years ago)

Untested

  • wp-includes/ms-deprecated.php

     
     1<?php
     2
     3function generate_random_password( $len = 8 ) {
     4        _deprecated_function( __FUNCTION__, '3.0', 'wp_generarte_password()' );
     5        $random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) );
     6        $random_password = apply_filters('random_password', $random_password);
     7        return $random_password;
     8}
     9
     10?>
     11 No newline at end of file
  • wp-includes/ms-functions.php

    Property changes on: wp-includes/ms-deprecated.php
    ___________________________________________________________________
    Name: svn:eol-style
       + native
    
     
    12141214        $user_login = $wpdb->escape($signup->user_login);
    12151215        $user_email = $wpdb->escape($signup->user_email);
    12161216        wpmu_validate_user_signup($user_login, $user_email);
    1217         $password = generate_random_password();
     1217        $password = wp_generate_password();
    12181218
    12191219        $user_id = username_exists($user_login);
    12201220
     
    12681268        return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta);
    12691269}
    12701270
    1271 function generate_random_password( $len = 8 ) {
    1272         $random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) );
    1273         $random_password = apply_filters('random_password', $random_password);
    1274         return $random_password;
    1275 }
    1276 
    12771271function wpmu_create_user( $user_name, $password, $email) {
    12781272        $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) );
    12791273        if ( username_exists($user_name) )
  • wp-settings.php

     
    405405if ( is_multisite() ) {
    406406        require_once( ABSPATH . WPINC . '/ms-functions.php' );
    407407        require_once( ABSPATH . WPINC . '/ms-default-filters.php' );
     408        require_once( ABSPATH . WPINC . '/ms-deprecated.php' );
    408409}
    409410
    410411if ( !defined('WP_CONTENT_URL') )
  • wp-admin/ms-edit.php

     
    157157                $password = 'N/A';
    158158                $user_id = email_exists($email);
    159159                if( !$user_id ) { // Create a new user with a random password
    160                         $password = generate_random_password();
     160                        $password = wp_generate_password();
    161161                        $user_id = wpmu_create_user( $domain, $password, $email );
    162162                        if(false == $user_id) {
    163163                                wp_die( __('There was an error creating the user') );