Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-18 18:17:16 +0300
committerJoas Schilling <coding@schilljs.com>2017-04-18 18:17:16 +0300
commit7f0a9f019371f297e49955a1097ba42d9608a2e7 (patch)
tree7495a63d740be811def26127504a8f7b96281df8 /lib
parent185751a5a53f16089be38d63a02b9c3c033344cb (diff)
Fix trailing new line
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PushController.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php
index c80e679..089428a 100644
--- a/lib/Controller/PushController.php
+++ b/lib/Controller/PushController.php
@@ -89,9 +89,10 @@ class PushController extends OCSController {
return new JSONResponse(['message' => 'INVALID_PUSHTOKEN_HASH'], Http::STATUS_BAD_REQUEST);
}
- if (strlen($devicePublicKey) !== 450 ||
- strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----') !== 0 ||
- strpos($devicePublicKey, '-----END PUBLIC KEY-----') !== 426) {
+ if (
+ (strlen($devicePublicKey) !== 450 && strpos($devicePublicKey, "\n" . '-----END PUBLIC KEY-----') !== 425) ||
+ (strlen($devicePublicKey) !== 451 && strpos($devicePublicKey, "\n" . '-----END PUBLIC KEY-----' . "\n") !== 425) ||
+ strpos($devicePublicKey, '-----BEGIN PUBLIC KEY-----' . "\n") !== 0) {
return new JSONResponse(['message' => 'INVALID_DEVICE_KEY'], Http::STATUS_BAD_REQUEST);
}