Skip to content

Commit

Permalink
Improve quoteId functionality for numberic detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Feb 6, 2024
1 parent 9897374 commit 81eb2e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Sql/AbstractSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,12 @@ public function quoteId(string $identifier): string
$identifierAry[$key] = ($val != '*') ? $this->openQuote . $val . $this->closeQuote : $val;
}
$quotedId = implode('.', $identifierAry);
} else if (($identifier != '*') &&
((preg_match('/^\$\d*\d$/', $identifier) == 0) && !is_int($identifier) &&
!is_float($identifier) && (preg_match('/^\d*$/', $identifier) == 0))) {
$quotedId = $this->openQuote . $identifier . $this->closeQuote;
} else {
$quotedId = ($identifier != '*') ? $this->openQuote . $identifier . $this->closeQuote : $identifier;
$quotedId = $identifier;
}

return $quotedId;
Expand Down Expand Up @@ -452,4 +456,4 @@ protected function initQuoteType(): void
}
}

}
}

0 comments on commit 81eb2e9

Please sign in to comment.