summaryrefslogtreecommitdiffstats
path: root/lib/vcategories.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-09-13 17:30:26 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-09-13 17:30:26 +0200
commitfdecee1bda0641eb0d1f215663a60a4ad559a6b8 (patch)
treea1330cb9069073bd6956a83d999f3ae0731afe60 /lib/vcategories.php
parent5a149dcfab960fe21c2df1bf4f1ba27f1a10b2c8 (diff)
downloadnextcloud-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.php5
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;
}
/**