Make WordPress Core

Ticket #34927: 34927.diff

File 34927.diff, 1013 bytes (added by samirmalpande, 6 years ago)

Patch to increase the length of user_email and user_url fields

  • src/wp-admin/includes/upgrade.php

    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index 85439b430a..e72c0899fa 100644
    a b function upgrade_all() { 
    769769        if ( $wp_current_db_version < 37965 ) {
    770770                upgrade_460();
    771771        }
     772       
     773        if ( $wp_current_db_version < 38590 ) {
     774                upgrade_500();
     775        }
    772776
    773777        maybe_disable_link_manager();
    774778
    function upgrade_460() { 
    20372041}
    20382042
    20392043/**
     2044 * Executes changes made in WordPress 5.0.0.
     2045 *
     2046 * @since 5.0.0
     2047 *
     2048 * @global int $wp_current_db_version Current database version.
     2049 */
     2050function upgrade_500() {
     2051        global $wp_current_db_version;
     2052
     2053        // Increasing the length of user_email and user_url fields
     2054        if ( $wp_current_db_version < 38590 ) {
     2055                $wpdb->query( "ALTER TABLE {$wpdb->users} MODIFY user_email VARCHAR(255)" );
     2056                $wpdb->query( "ALTER TABLE {$wpdb->users} MODIFY user_url VARCHAR(255)" );
     2057        }
     2058}
     2059
     2060/**
    20402061 * Executes network-level upgrade routines.
    20412062 *
    20422063 * @since 3.0.0