|
|
@@ -38,19 +38,19 @@ trait SqlDialectTrait
|
|
|
}
|
|
|
|
|
|
// string
|
|
|
- if (preg_match('/^[\w-]+$/', $identifier)) {
|
|
|
+ if (preg_match('/^[\w-]+$/u', $identifier)) {
|
|
|
return $this->_startQuote . $identifier . $this->_endQuote;
|
|
|
}
|
|
|
|
|
|
// string.string
|
|
|
- if (preg_match('/^[\w-]+\.[^ \*]*$/', $identifier)) {
|
|
|
+ if (preg_match('/^[\w-]+\.[^ \*]*$/u', $identifier)) {
|
|
|
$items = explode('.', $identifier);
|
|
|
|
|
|
return $this->_startQuote . implode($this->_endQuote . '.' . $this->_startQuote, $items) . $this->_endQuote;
|
|
|
}
|
|
|
|
|
|
// string.*
|
|
|
- if (preg_match('/^[\w-]+\.\*$/', $identifier)) {
|
|
|
+ if (preg_match('/^[\w-]+\.\*$/u', $identifier)) {
|
|
|
return $this->_startQuote . str_replace('.*', $this->_endQuote . '.*', $identifier);
|
|
|
}
|
|
|
|
|
|
@@ -60,19 +60,19 @@ trait SqlDialectTrait
|
|
|
}
|
|
|
|
|
|
// Alias.field AS thing
|
|
|
- if (preg_match('/^([\w-]+(\.[\w-\s]+|\(.*\))*)\s+AS\s*([\w-]+)$/i', $identifier, $matches)) {
|
|
|
+ if (preg_match('/^([\w-]+(\.[\w-\s]+|\(.*\))*)\s+AS\s*([\w-]+)$/ui', $identifier, $matches)) {
|
|
|
return $this->quoteIdentifier($matches[1]) . ' AS ' . $this->quoteIdentifier($matches[3]);
|
|
|
}
|
|
|
|
|
|
// string.string with spaces
|
|
|
- if (preg_match('/^([\w-]+\.[\w][\w\s\-]*[\w])(.*)/', $identifier, $matches)) {
|
|
|
+ if (preg_match('/^([\w-]+\.[\w][\w\s\-]*[\w])(.*)/u', $identifier, $matches)) {
|
|
|
$items = explode('.', $matches[1]);
|
|
|
$field = implode($this->_endQuote . '.' . $this->_startQuote, $items);
|
|
|
|
|
|
return $this->_startQuote . $field . $this->_endQuote . $matches[2];
|
|
|
}
|
|
|
|
|
|
- if (preg_match('/^[\w-_\s]*[\w-_]+/', $identifier)) {
|
|
|
+ if (preg_match('/^[\w-_\s]*[\w-_]+/u', $identifier)) {
|
|
|
return $this->_startQuote . $identifier . $this->_endQuote;
|
|
|
}
|
|
|
|