WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/23/2016 06:11:32 PM (5 years ago)
Author:
ocean90
Message:

Database: Support backticks around field names when parsing a query for the field type.

Avoids an undefined index PHP warning by dbDelta().

Props davidmosterd, ocean90.
See #20263.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r37533 r37538  
    22222222
    22232223                // Get the field type from the query.
    2224                 preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[ $tablefield_field_lowercased ], $matches);
     2224                preg_match( '|`?' . $tablefield->Field . '`? ([^ ]*( unsigned)?)|i', $cfields[ $tablefield_field_lowercased ], $matches );
    22252225                $fieldtype = $matches[1];
    22262226                $fieldtype_lowercased = strtolower( $fieldtype );
Note: See TracChangeset for help on using the changeset viewer.