From 7d7654caa019cb3ed3c39aa1b4eb8c1f3bf5caae Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 24 Aug 2012 12:28:28 +1200 Subject: [PATCH] FIXED: Critical issue where index columns would be split apart and rejoined assuming they were not quoted. Already quoted columns would end up quad (dobule x double) quoted. --- code/MSSQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index dca15fc..48274f0 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -858,7 +858,7 @@ class MSSQLDatabase extends SS_Database { } if($indexSpec['type'] == 'unique') { - if(!is_array($indexSpec['value'])) $columns = preg_split('/ *, */', trim($indexSpec['value'])); + if(!is_array($indexSpec['value'])) $columns = preg_split('/"? *, *"?/', trim(trim($indexSpec['value']), '"')); else $columns = $indexSpec['value']; $SQL_columnList = '"' . implode('", "', $columns) . '"';