From fefcbb966b6c41b9440f67b8121b9c97e1ce7df0 Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@owncloud.com>
Date: Thu, 12 Mar 2015 09:18:43 +0100
Subject: [PATCH] Also use all keys for an empty array, just in case

---
 lib/private/db/adapter.php       | 2 +-
 lib/private/db/adaptersqlite.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/private/db/adapter.php b/lib/private/db/adapter.php
index d0641f113f..de7b04c74d 100644
--- a/lib/private/db/adapter.php
+++ b/lib/private/db/adapter.php
@@ -50,7 +50,7 @@ class Adapter {
 	 * @throws \Doctrine\DBAL\DBALException
 	 */
 	public function insertIfNotExist($table, $input, array $compare = null) {
-		if ($compare === null) {
+		if (empty($compare)) {
 			$compare = array_keys($input);
 		}
 		$query = 'INSERT INTO `' .$table . '` (`'
diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php
index 1528285e11..31f88940f0 100644
--- a/lib/private/db/adaptersqlite.php
+++ b/lib/private/db/adaptersqlite.php
@@ -29,7 +29,7 @@ class AdapterSqlite extends Adapter {
 	 * @throws \Doctrine\DBAL\DBALException
 	 */
 	public function insertIfNotExist($table, $input, array $compare = null) {
-		if ($compare === null) {
+		if (empty($compare)) {
 			$compare = array_keys($input);
 		}
 		$fieldList = '`' . implode('`,`', array_keys($input)) . '`';
-- 
GitLab