Skip to content

Commit 6f440cb

Browse files
committed
fix boolean strict comparison
1 parent 191df2d commit 6f440cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/WebPush.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function setBrowser($browser)
296296
*/
297297
public function isAutomaticPadding()
298298
{
299-
return $this->automaticPadding != false;
299+
return $this->automaticPadding !== false && $this->automaticPadding !== 0;
300300
}
301301

302302
/**
@@ -316,9 +316,9 @@ public function setAutomaticPadding($automaticPadding)
316316
{
317317
if ($automaticPadding > Encryption::MAX_PAYLOAD_LENGTH) {
318318
throw new \Exception('Automatic padding is too large. Max is '.Encryption::MAX_PAYLOAD_LENGTH.'. Recommended max is '.Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH.' for compatibility reasons (see README).');
319-
} else if ($automaticPadding < 0) {
319+
} elseif ($automaticPadding < 0) {
320320
throw new \Exception('Padding length should be positive or zero.');
321-
} else if ($automaticPadding === true) {
321+
} elseif ($automaticPadding === true) {
322322
$this->automaticPadding = Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH;
323323
} else {
324324
$this->automaticPadding = $automaticPadding;

0 commit comments

Comments
 (0)