Skip to content
Permalink
Browse files

Fix regex for PHP 7.3.

  • Loading branch information...
ADmad committed Sep 29, 2018
1 parent 249cbc3 commit e2891f617281f6143abd18bee4237704f19c4f98
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Database/SqlDialectTrait.php
@@ -60,7 +60,7 @@ public function quoteIdentifier($identifier)
}
// 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-]+)$/i', $identifier, $matches)) {
return $this->quoteIdentifier($matches[1]) . ' AS ' . $this->quoteIdentifier($matches[3]);
}
@@ -72,7 +72,7 @@ public function quoteIdentifier($identifier)
return $this->_startQuote . $field . $this->_endQuote . $matches[2];
}
if (preg_match('/^[\w-_\s]*[\w-_]+/', $identifier)) {
if (preg_match('/^[\w_\s-]*[\w_-]+/', $identifier)) {
return $this->_startQuote . $identifier . $this->_endQuote;
}

0 comments on commit e2891f6

Please sign in to comment.
You can’t perform that action at this time.