Skip to content

Commit

Permalink
Fixed - don't show PHP error when license check fails
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIgna committed Jul 4, 2019
1 parent 7dc3eda commit 8aff514
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public function getMarketUrl($path = '') {
}

public function getLicenseKey() {
return constant(str_replace('-', '_', strtoupper($this->slug . '_' . $this->type . '_license_key')));
$name = str_replace('-', '_', strtoupper($this->slug . '_' . $this->type . '_license_key'))

return defined($name) ? constant($name) : null;
}

public function getLicense() {
Expand Down Expand Up @@ -99,7 +101,7 @@ public function licenseDetails() {
<small><a href="<?php echo add_query_arg($this->slug . '-recheck-license', 1) ?>" title="Recheck License">↻</a></small>
</p>
<p><strong>Auto renew:</strong> <?php echo $license['autoRenew'] ? 'Yes' : 'No' ?></p>
<p><a href="https://layered.market/licenses/<?php echo $this->getLicenseKey() ?>" target="_blank">Manage License on Layered Market</a></p>
<p><a href="https://layered.market/licenses/<?php echo $this->getLicenseKey() ?>" target="_blank">Manage License on Layered Market</a></p>

<?php
}
Expand Down

0 comments on commit 8aff514

Please sign in to comment.