]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if categories is an array.
authorThomas Tanghus <thomas@tanghus.net>
Thu, 13 Sep 2012 15:30:26 +0000 (17:30 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 13 Sep 2012 15:30:26 +0000 (17:30 +0200)
lib/vcategories.php

index f5123adeeb641ff3e87c73bf7c9e45b777af6b4e..6b1d6a316f1660bcd0e218e793892041892abffe 100644 (file)
@@ -55,7 +55,10 @@ class OC_VCategories {
                $this->app = $app;
                $this->user = is_null($user) ? OC_User::getUser() : $user;
                $categories = trim(OC_Preferences::getValue($this->user, $app, self::PREF_CATEGORIES_LABEL, ''));
-               $this->categories = $categories != '' ? @unserialize($categories) : $defcategories;
+               if ($categories) {
+                       $categories = @unserialize($categories);
+               }
+               $this->categories = is_array($categories) ? $categories : $defcategories;
        }
 
        /**