added backslashes in regex to allow matching namespaces in ClassName field

This commit is contained in:
Klemen Dolinšek 2021-02-24 09:37:13 +01:00
parent bd0d90abff
commit 8d69a20b49

View File

@ -390,7 +390,7 @@ class MSSQLSchemaManager extends DBSchemaManager
// First, we split the column specifications into parts // First, we split the column specifications into parts
// TODO: this returns an empty array for the following string: int(11) not null auto_increment // TODO: this returns an empty array for the following string: int(11) not null auto_increment
// on second thoughts, why is an auto_increment field being passed through? // on second thoughts, why is an auto_increment field being passed through?
$pattern = '/^(?<definition>[\w()]+)\s?(?<null>(?:not\s)?null)?\s?(?<default>default\s[\w\']+)?\s?(?<check>check\s?[\w()\'",\s]+)?$/i'; $pattern = '/^(?<definition>[\w()]+)\s?(?<null>(?:not\s)?null)?\s?(?<default>default\s[\w\'\\\\]+)?\s?(?<check>check\s?[\w()\'"\\\\,\s]+)?/i';
$matches = array(); $matches = array();
preg_match($pattern, $colSpec, $matches); preg_match($pattern, $colSpec, $matches);