From c2dd3036e3877630b8b78d58f27b1783f651e27f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 22 Apr 2013 22:00:50 +0000 Subject: [PATCH] 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 --- wp-admin/includes/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 4f9f3384f8..2957d52ca1 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1566,7 +1566,7 @@ function dbDelta( $queries = '', $execute = true ) { // Get the default value from the array //echo "{$cfields[strtolower($tablefield->Field)]}
"; - 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