Handle blank subdomains + Push notifications refactor (#1870)

* refactor for push notifications

* handle blank subdomains
This commit is contained in:
David Bomba 2018-02-04 20:04:43 +11:00 committed by GitHub
parent 8f4cba1ed8
commit 7f451ae403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 25 deletions

View File

@ -184,12 +184,10 @@ class AccountApiController extends BaseAPIController
$devices = json_decode($account->devices, true);
foreach($devices as $key => $value)
for($x=0; $x<count($devices); $x++)
{
if($request->token == $value['token'])
unset($devices[$key]);
if($request->token == $devices[$x]['token'])
unset($devices[$x]);
}
$account->devices = json_encode(array_values($devices));

View File

@ -13,6 +13,9 @@ class Cloudflare
$zones = json_decode(env('CLOUDFLARE_ZONE_IDS',''), true);
foreach($zones as $zone)
{
if($account->subdomain != "")
{
$curl = curl_init();
@ -43,6 +46,8 @@ class Cloudflare
}
}
}