Skip to content

Commit

Permalink
Fix regex for PHP 7.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 29, 2018
1 parent 249cbc3 commit e2891f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/SqlDialectTrait.php
Expand Up @@ -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]);
}

Expand All @@ -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;
}

Expand Down

0 comments on commit e2891f6

Please sign in to comment.