WordPress.org

Make WordPress Core

Ticket #20263: 20263.diff

File 20263.diff, 791 bytes (added by davidmosterd, 6 years ago)
  • src/wp-admin/includes/upgrade.php

    diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
    index 1398838..0c11a8a 100644
    function dbDelta( $queries = '', $execute = true ) { 
    18971897                        if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
    18981898
    18991899                                // Get the field type from the query.
    1900                                 preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
     1900                                $parts = explode( $tablefield->Field, $cfields[ $tablefield->Field ], 2 );
     1901                                $remainder = ltrim( $parts[1], ' `' );
     1902
     1903                                preg_match( '/([^ ]+( unsigned)?)/i', $remainder, $matches );
     1904
    19011905                                $fieldtype = $matches[1];
    19021906
    19031907                                // Is actual field type different from the field type in query?