From c0ab9cb0c1cff90d27318ee75446cf25b85407ce Mon Sep 17 00:00:00 2001 From: Ahmed Fathy Date: Sun, 14 Apr 2019 13:49:51 +0200 Subject: [PATCH] fix onesignal validation pattern --- src/Models/Traits/HasApiAuthentication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Traits/HasApiAuthentication.php b/src/Models/Traits/HasApiAuthentication.php index 35f802f..e419b13 100644 --- a/src/Models/Traits/HasApiAuthentication.php +++ b/src/Models/Traits/HasApiAuthentication.php @@ -27,7 +27,7 @@ public function canLoginWithApi() */ public function addOneSignalToken($token) { - if ($token && preg_match("/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}/", $token)) { + if ($token && preg_match("/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}$/", $token)) { // Delete previous tokens. ServiceToken::where('name', ServiceToken::ONESIGNAL) ->where(compact('token'))