Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Aug 26, 2024
1 parent 1b92ccc commit 5dad14e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/Http/Controllers/PackagesJsonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,19 @@ public function validateLicenses($request, $whmcsServerId)

$userLicenseKeys = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6));

$userLicenseKeys = trim($userLicenseKeys,':');
$userLicenseKeys = trim($userLicenseKeys,' ');

$userLicenseKeysIsBase64FromUsername = @base64_decode($userLicenseKeys);
if (is_string($userLicenseKeysIsBase64FromUsername) and (str_starts_with(strtolower($userLicenseKeysIsBase64FromUsername), 'license:'))) {
/// for phyre panel
$userLicenseKeys = substr($userLicenseKeysIsBase64FromUsername, 8);
if(StringHelper::isBase64Encoded($userLicenseKeys)){
$userLicenseKeys = base64_decode($userLicenseKeys);
}
}


if (is_string($userLicenseKeys) and (strpos(strtolower($userLicenseKeys), 'license:') !== false)) {
$userLicenseKeys = substr($userLicenseKeys, 8);
if(StringHelper::isBase64Encoded($userLicenseKeys)){
Expand All @@ -579,6 +592,7 @@ public function validateLicenses($request, $whmcsServerId)
}

if(StringHelper::isJSON($userLicenseKeys)) {

$userLicenseKeysJson = json_decode($userLicenseKeys, true);
} else {
$userLicenseKeysJson = [];
Expand Down

0 comments on commit 5dad14e

Please sign in to comment.