]> source.dussan.org Git - nextcloud-server.git/commitdiff
Also use all keys for an empty array, just in case
authorJoas Schilling <nickvergessen@owncloud.com>
Thu, 12 Mar 2015 08:18:43 +0000 (09:18 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Thu, 12 Mar 2015 08:18:43 +0000 (09:18 +0100)
lib/private/db/adapter.php
lib/private/db/adaptersqlite.php

index d0641f113f3c53020231e2e7c70a4c475b4e3e2c..de7b04c74db97d534d0874203136a736ec79c683 100644 (file)
@@ -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 . '` (`'
index 1528285e11a7b05dfc84786787b9b4f77377c8f6..31f88940f0b1bd1d3bf3b8634c8630240ec12ecf 100644 (file)
@@ -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)) . '`';