Making WordPress.org

Ticket #7860: 7860.patch

File 7860.patch, 3.6 KB (added by haozi, 6 months ago)
  • api.wordpress.org/public_html/core/credits/wp-credits.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/api.wordpress.org/public_html/core/credits/wp-credits.php b/api.wordpress.org/public_html/core/credits/wp-credits.php
    a b  
    221221                        if ( $user->user_nicename == 'nacin' ) // I stopped taking Spanish in 11th grade, don't show me as a validator when I'm testing things.
    222222                                continue;
    223223                        if ( $user->display_name && $user->display_name != $user->user_nicename && false === strpos( $user->display_name , '?') )
    224                                 $validators[ $user->user_nicename ] = array( $this->_encode( $user->display_name ), md5( $user->user_email ), $user->user_nicename );
     224                                $validators[ $user->user_nicename ] = array( $this->_encode( $user->display_name ), hash( 'sha256', $user->user_email ), $user->user_nicename );
    225225                        else
    226                                 $validators[ $user->user_nicename ] = array( $user->user_nicename, md5( $user->user_email ), $user->user_nicename );
     226                                $validators[ $user->user_nicename ] = array( $user->user_nicename, hash( 'sha256', $user->user_email ), $user->user_nicename );
    227227                }
    228228
    229229                return $validators;
     
    299299                                $this->names_in_groups[] = strtolower( $k );
    300300
    301301                                if ( ! empty( $person[2] ) ) {
    302                                         // array( 'Andrew Nacin', 'Lead Developer', 'md5 hash' )
     302                                        // array( 'Andrew Nacin', 'Lead Developer', 'sha256 hash' )
    303303                                        $new_data['title'] = $person[1];
    304304                                        $new_data['hash'] = $person[2];
    305305                                } elseif ( empty( $person[1] ) ) {
    306306                                        // array( 'Andrew Nacin' )
    307307                                        $fetch_emails_from_user_cache[ $k ] = $group_slug;
    308308                                } elseif ( strlen( $person[1] ) === 32 && preg_match('/^[a-f0-9]{32}$/', $person[1] ) ) {
    309                                         // array( 'Andrew Nacin', 'md5 hash' )
     309                                        // array( 'Andrew Nacin', 'sha256 hash' )
    310310                                        $new_data['hash'] = $person[1];
    311311                                } else {
    312312                                        // array( 'Andrew Nacin', 'Lead Developer' )
     
    315315                                }
    316316
    317317                                // Temporary:
    318                                 if ( strlen( $new_data['hash'] ) != 32 || strpos( $new_data['hash'], '@' ) ) {
    319                                         $new_data['hash'] = md5( $new_data['hash'] );
     318                                if ( strlen( $new_data['hash'] ) != 64 || strpos( $new_data['hash'], '@' ) ) {
     319                                        $new_data['hash'] = hash( 'sha256', $new_data['hash'] );
    320320                                }
    321321
    322322                                $group_data['data'][ $k ] = array_values( $new_data );
     
    330330                                $user_id = wp_cache_get( $username, 'userlogins' );
    331331                                if ( $user_id ) {
    332332                                        if ( $user_object = wp_cache_get( $user_id, 'users' ) ) {
    333                                                 $groups[ $group ]['data'][ $username ][1] = md5( strtolower( $user_object->user_email ) );
     333                                                $groups[ $group ]['data'][ $username ][1] = hash( 'sha256', strtolower( $user_object->user_email ) );
    334334                                        } else {
    335335                                                $fetch_emails_from_db[ $username ] = $group;
    336336                                        }
     
    341341                        if ( $fetch_emails_from_db ) {
    342342                                $fetched = $wpdb->get_results( "SELECT user_login, ID, user_email FROM $wpdb->users WHERE user_login IN ('" . implode( "', '", array_keys( $fetch_emails_from_db ) ) . "')", OBJECT_K );
    343343                                foreach ( $fetched as $username => $row ) {
    344                                         $groups[ $fetch_emails_from_db[ $username ] ]['data'][ $username ][1] = md5( strtolower( $row->user_email ) );
     344                                        $groups[ $fetch_emails_from_db[ $username ] ]['data'][ $username ][1] = hash( 'sha256', strtolower( $row->user_email ) );
    345345                                        wp_cache_add( $username, $row->ID, 'userlogins' );
    346346                                }
    347347                        }