Safer queries
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
0a1135a7cc
commit
199405ddc0
1 changed files with 2 additions and 2 deletions
|
@ -142,13 +142,13 @@ class CleanupRemoteStorages extends Command {
|
|||
->where($queryBuilder->expr()->like(
|
||||
'id',
|
||||
// match all 'shared::' + 32 characters storages
|
||||
$queryBuilder->createNamedParameter('shared::________________________________', IQueryBuilder::PARAM_STR),
|
||||
$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)),
|
||||
IQueryBuilder::PARAM_STR)
|
||||
)
|
||||
->andWhere($queryBuilder->expr()->notLike(
|
||||
'id',
|
||||
// but not the ones starting with a '/', they are for normal shares
|
||||
$queryBuilder->createNamedParameter('shared::/%', IQueryBuilder::PARAM_STR),
|
||||
$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
|
||||
IQueryBuilder::PARAM_STR)
|
||||
)->orderBy('numeric_id');
|
||||
$query = $queryBuilder->execute();
|
||||
|
|
Loading…
Reference in a new issue