dbDelta: When parsing out the DEFAULT value, avoid being too greedy. props hbanken, fixes #15948.

git-svn-id: https://develop.svn.wordpress.org/trunk@24065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-04-22 22:00:50 +00:00
parent c459c13113
commit c2dd3036e3
1 changed files with 1 additions and 1 deletions

View File

@ -1566,7 +1566,7 @@ function dbDelta( $queries = '', $execute = true ) {
// Get the default value from the array
//echo "{$cfields[strtolower($tablefield->Field)]}<br>";
if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
if (preg_match("| DEFAULT '(.*?)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
$default_value = $matches[1];
if ($tablefield->Default != $default_value) {
// Add a query to change the column's default value