This commit is contained in:
Hank Jordan 2021-06-03 19:51:37 +02:00 committed by GitHub
commit 27ea68fb49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,8 @@ use OCP\DB\QueryBuilder\ILiteral;
use OCP\DB\QueryBuilder\IParameter;
use OCP\DB\QueryBuilder\IQueryFunction;
use Doctrine\DBAL\Schema\Column;
class QuoteHelper {
/**
* @param array|string|ILiteral|IParameter|IQueryFunction $strings string, Literal or Parameter
@ -57,6 +59,10 @@ class QuoteHelper {
if ($string === null || $string === 'null' || $string === '*') {
return $string;
}
if ($string instanceof Column) {
return $string->getName();
}
if (!is_string($string)) {
throw new \InvalidArgumentException('Only strings, Literals and Parameters are allowed');