mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Fix default value for $type in OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::literal
This fixes PHP errors about passing null to PDO::quote second parameter. We may want to change IExpressionBuilder as well? Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
10dfdedcbd
commit
18a91f02fa
2 changed files with 4 additions and 4 deletions
|
|
@ -414,11 +414,11 @@ class ExpressionBuilder implements IExpressionBuilder {
|
|||
* Quotes a given input parameter.
|
||||
*
|
||||
* @param mixed $input The parameter to be quoted.
|
||||
* @param mixed|null $type One of the IQueryBuilder::PARAM_* constants
|
||||
* @param int $type One of the IQueryBuilder::PARAM_* constants
|
||||
*
|
||||
* @return ILiteral
|
||||
*/
|
||||
public function literal($input, $type = null): ILiteral {
|
||||
public function literal($input, $type = IQueryBuilder::PARAM_STR): ILiteral {
|
||||
return new Literal($this->expressionBuilder->literal($input, $type));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ interface IExpressionBuilder {
|
|||
* Quotes a given input parameter.
|
||||
*
|
||||
* @param mixed $input The parameter to be quoted.
|
||||
* @param mixed|null $type One of the IQueryBuilder::PARAM_* constants
|
||||
* @param int $type One of the IQueryBuilder::PARAM_* constants
|
||||
*
|
||||
* @return ILiteral
|
||||
* @since 8.2.0
|
||||
|
|
@ -426,7 +426,7 @@ interface IExpressionBuilder {
|
|||
* @psalm-taint-sink sql $input
|
||||
* @psalm-taint-sink sql $type
|
||||
*/
|
||||
public function literal($input, $type = null): ILiteral;
|
||||
public function literal($input, $type = IQueryBuilder::PARAM_STR): ILiteral;
|
||||
|
||||
/**
|
||||
* Returns a IQueryFunction that casts the column to the given type
|
||||
|
|
|
|||
Loading…
Reference in a new issue