summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-01 17:06:38 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-08 09:01:01 +0200
commitd04021b1ac8e9717adb39111622a7d024d90502d (patch)
tree91b1f896c3b0920222dc0b9404c9c7f5e35d2e5b
parent21b83dc730c9eebd9eb4d8c9944f680514eb2121 (diff)
downloadnextcloud-server-d04021b1ac8e9717adb39111622a7d024d90502d.tar.gz
nextcloud-server-d04021b1ac8e9717adb39111622a7d024d90502d.zip
Fix the request type and the validity
-rw-r--r--lib/private/notification/action.php1
-rw-r--r--lib/private/notification/notification.php6
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/notification/action.php b/lib/private/notification/action.php
index 08f3d50bac2..f0bcb23c877 100644
--- a/lib/private/notification/action.php
+++ b/lib/private/notification/action.php
@@ -110,6 +110,7 @@ class Action implements IAction {
throw new \InvalidArgumentException('The given request type is invalid');
}
$this->link = $link;
+ $this->requestType = $requestType;
return $this;
}
diff --git a/lib/private/notification/notification.php b/lib/private/notification/notification.php
index 9262a198b52..17246ddef32 100644
--- a/lib/private/notification/notification.php
+++ b/lib/private/notification/notification.php
@@ -316,7 +316,7 @@ class Notification implements INotification {
* @since 8.2.0
*/
public function setLink($link) {
- if (!is_string($link) || $link === '' || isset($link[256])) {
+ if (!is_string($link) || $link === '' || isset($link[4000])) {
throw new \InvalidArgumentException('The given link is invalid');
}
$this->link = $link;
@@ -368,7 +368,7 @@ class Notification implements INotification {
* @since 8.2.0
*/
public function addAction(IAction $action) {
- if ($action->isValid()) {
+ if (!$action->isValid()) {
throw new \InvalidArgumentException('The given action is invalid');
}
$this->actions[] = $action;
@@ -390,7 +390,7 @@ class Notification implements INotification {
* @since 8.2.0
*/
public function addParsedAction(IAction $action) {
- if ($action->isValidParsed()) {
+ if (!$action->isValidParsed()) {
throw new \InvalidArgumentException('The given parsed action is invalid');
}
$this->actions[] = $action;