summaryrefslogtreecommitdiffstats
path: root/lib/private/activitymanager.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-02-13 11:50:55 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-02-13 11:50:55 +0100
commitbe63e18b0aaf403dab86b3b42500e5e4b18183e4 (patch)
tree89e13738a4372878d5bc9c9324c0491a0ee896cf /lib/private/activitymanager.php
parentc02de748e56b559b7429f232d5d07606e90d4b44 (diff)
downloadnextcloud-server-be63e18b0aaf403dab86b3b42500e5e4b18183e4.tar.gz
nextcloud-server-be63e18b0aaf403dab86b3b42500e5e4b18183e4.zip
Check whether filter is valid, before doing stuff for it
Diffstat (limited to 'lib/private/activitymanager.php')
-rw-r--r--lib/private/activitymanager.php13
1 files changed, 12 insertions, 1 deletions
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();