Skip to content

Commit

Permalink
Correct keys validation expression
Browse files Browse the repository at this point in the history
  • Loading branch information
seba-aln committed Jan 2, 2025
1 parent 1168be2 commit 87962c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PubNub/Endpoints/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected function validateSubscribeKey()
{
$subscribeKey = $this->pubnub->getConfiguration()->getSubscribeKey();

if ($subscribeKey == null) {
if ($subscribeKey == null || empty($subscribeKey)) {
throw new PubNubValidationException("Subscribe Key not configured");
}
}
Expand All @@ -142,7 +142,7 @@ protected function validatePublishKey()
{
$publishKey = $this->pubnub->getConfiguration()->getPublishKey();

if ($publishKey == null) {
if ($publishKey == null || empty($publishKey)) {
throw new PubNubValidationException("Publish Key not configured");
}
}
Expand All @@ -154,7 +154,7 @@ protected function validateSecretKey()
{
$secretKey = $this->pubnub->getConfiguration()->getSecretKey();

if ($secretKey === null) {
if ($secretKey === null || empty($secretKey)) {
throw new PubNubValidationException("Secret key not configured");
}
}
Expand Down

0 comments on commit 87962c5

Please sign in to comment.