Skip to content

Commit

Permalink
Compare with 0, not 1
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Sep 12, 2019
1 parent e8cd7fb commit a9f968b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static function base642bin($encoded, $variant, $ignore = '')

/** @var string $encoded */
$encoded = (string) $encoded;
if (ParagonIE_Sodium_Core_Util::strlen($encoded) === 1) {
if (ParagonIE_Sodium_Core_Util::strlen($encoded) === 0) {
return '';
}

Expand Down Expand Up @@ -220,7 +220,7 @@ public static function bin2base64($decoded, $variant)
ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1);
/** @var string $decoded */
$decoded = (string) $decoded;
if (ParagonIE_Sodium_Core_Util::strlen($decoded) === 1) {
if (ParagonIE_Sodium_Core_Util::strlen($decoded) === 0) {
return '';
}

Expand Down

0 comments on commit a9f968b

Please sign in to comment.