diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-09-13 17:30:26 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-09-13 17:30:26 +0200 |
commit | fdecee1bda0641eb0d1f215663a60a4ad559a6b8 (patch) | |
tree | a1330cb9069073bd6956a83d999f3ae0731afe60 /lib/vcategories.php | |
parent | 5a149dcfab960fe21c2df1bf4f1ba27f1a10b2c8 (diff) | |
download | nextcloud-server-fdecee1bda0641eb0d1f215663a60a4ad559a6b8.tar.gz nextcloud-server-fdecee1bda0641eb0d1f215663a60a4ad559a6b8.zip |
Check if categories is an array.
Diffstat (limited to 'lib/vcategories.php')
-rw-r--r-- | lib/vcategories.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vcategories.php b/lib/vcategories.php index f5123adeeb6..6b1d6a316f1 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -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; } /** |