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

git-svn-id: http://core.svn.wordpress.org/trunk@24065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-04-22 22:00:50 +00:00
parent 95ed7c929f
commit e7b2915ecd
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