summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-11-09 17:33:05 +0100
committerJoas Schilling <coding@schilljs.com>2020-11-10 15:36:26 +0100
commit1aa9c9164d73be7aabb5a2ff18e8999c55e33a48 (patch)
treeb882362abd43761f86758fa31cc5292a66a7dc12 /lib/private/DB
parentcffad62771a1640675e92fdc6a85ff013bac2ec4 (diff)
downloadnextcloud-server-1aa9c9164d73be7aabb5a2ff18e8999c55e33a48.tar.gz
nextcloud-server-1aa9c9164d73be7aabb5a2ff18e8999c55e33a48.zip
Fix comparing the empty string for global credentials
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/Connection.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index 6835226357f..0ea71637943 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -332,11 +332,17 @@ class Connection extends ReconnectWrapper implements IDBConnection {
$where = $updateQb->expr()->andX();
$whereValues = array_merge($keys, $updatePreconditionValues);
foreach ($whereValues as $name => $value) {
- $where->add($updateQb->expr()->eq(
- $name,
- $updateQb->createNamedParameter($value, $this->getType($value)),
- $this->getType($value)
- ));
+ if ($value === '') {
+ $where->add($updateQb->expr()->emptyString(
+ $name
+ ));
+ } else {
+ $where->add($updateQb->expr()->eq(
+ $name,
+ $updateQb->createNamedParameter($value, $this->getType($value)),
+ $this->getType($value)
+ ));
+ }
}
$updateQb->where($where);
$affected = $updateQb->execute();