Fix empty preferences array warning in the DbStore

This commit is contained in:
Alexander Fuhr 2014-11-12 17:03:22 +01:00
parent 993390941a
commit c7f36a5afa
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ class DbStore extends PreferencesStore
if (! array_key_exists($section, $this->preferences)) {
$this->preferences[$section] = array();
}
if (! array_key_exists($section, $preferences)) {
$preferences[$section] = array();
}
$toBeInserted = array_diff_key($preferences[$section], $this->preferences[$section]);
if (!empty($toBeInserted)) {
$this->insert($toBeInserted, $section);