From d989c15a2a2e73eb6ddf434ed7b3cb6fcfba560c Mon Sep 17 00:00:00 2001 From: Andreas Piening Date: Thu, 24 Jun 2010 06:12:53 +0000 Subject: [PATCH] MINOR: catch wider range of create strings --- code/SQLite3Database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index 7e9ed7a..9edcae9 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -467,7 +467,7 @@ class SQLite3Database extends SS_Database { $fieldList = array(); if($sqlCreate && $sqlCreate['sql']) { - preg_match('/^[\s]*CREATE[\s]+TABLE[\s]+[\'"][a-zA-Z0-9_]+[\'"][\s]*\((.+)\)[\s]*$/ims', $sqlCreate['sql'], $matches); + preg_match('/^[\s]*CREATE[\s]+TABLE[\s]+[\'"]?[a-zA-Z0-9_]+[\'"]?[\s]*\((.+)\)[\s]*$/ims', $sqlCreate['sql'], $matches); $fields = isset($matches[1]) ? preg_split('/,(?=(?:[^\'"]*$)|(?:[^\'"]*[\'"][^\'"]*[\'"][^\'"]*)*$)/x', $matches[1]) : array(); foreach($fields as $field) { $details = preg_split('/\s/', trim($field));