From be63e18b0aaf403dab86b3b42500e5e4b18183e4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 13 Feb 2015 11:50:55 +0100 Subject: Check whether filter is valid, before doing stuff for it --- lib/private/activitymanager.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/activitymanager.php b/lib/private/activitymanager.php index b7999d0216a..ee7059d492d 100644 --- a/lib/private/activitymanager.php +++ b/lib/private/activitymanager.php @@ -26,7 +26,11 @@ class ActivityManager implements IManager { private $extensions = array(); /** @var array list of filters "name" => "is valid" */ - protected $validFilters = array(); + protected $validFilters = array( + 'all' => true, + 'by' => true, + 'self' => true, + ); /** @var array list of type icons "type" => "css class" */ protected $typeIcons = array(); @@ -123,6 +127,10 @@ class ActivityManager implements IManager { * @return array */ function filterNotificationTypes($types, $filter) { + if (!$this->isFilterValid($filter)) { + return $types; + } + foreach($this->extensions as $extension) { $c = $extension(); if ($c instanceof IExtension) { @@ -297,6 +305,9 @@ class ActivityManager implements IManager { * @return array */ function getQueryForFilter($filter) { + if (!$this->isFilterValid($filter)) { + return [null, null]; + } $conditions = array(); $parameters = array(); -- cgit v1.2.3