mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX: Made MSSQLDatabase::EnumValuesFromConstraint more robust
This commit is contained in:
parent
7a1d6d7bcf
commit
cedc941410
@ -394,10 +394,10 @@ class MSSQLDatabase extends Database {
|
|||||||
* Get the actual enum fields from the constraint value:
|
* Get the actual enum fields from the constraint value:
|
||||||
*/
|
*/
|
||||||
private function EnumValuesFromConstraint($constraint){
|
private function EnumValuesFromConstraint($constraint){
|
||||||
$segments=explode(' OR [', $constraint);
|
$segments=preg_split('/ +OR *\[/i', $constraint);
|
||||||
$constraints=Array();
|
$constraints=Array();
|
||||||
foreach($segments as $this_segment){
|
foreach($segments as $this_segment){
|
||||||
$bits=explode(' = ', $this_segment);
|
$bits=preg_split('/ *= */', $this_segment);
|
||||||
|
|
||||||
for($i=1; $i<sizeof($bits); $i+=2)
|
for($i=1; $i<sizeof($bits); $i+=2)
|
||||||
array_unshift($constraints, substr(rtrim($bits[$i], ')'), 1, -1));
|
array_unshift($constraints, substr(rtrim($bits[$i], ')'), 1, -1));
|
||||||
|
Loading…
Reference in New Issue
Block a user