Skip to content

Commit

Permalink
Crypt/Base: simplify logic using de morgan's law
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Dec 2, 2023
1 parent f404932 commit df1203f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions phpseclib/Crypt/Base.php
Expand Up @@ -514,11 +514,13 @@ function __construct($mode = self::MODE_CBC)
switch (true) {
// PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster
case (PHP_OS & "\xDF\xDF\xDF") === 'WIN':
case !(function_exists('php_uname') && is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM'):
case !function_exists('php_uname'):
case !is_string(php_uname('m')):
case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
case PHP_INT_SIZE == 8:
define('CRYPT_BASE_USE_REG_INTVAL', true);
break;
case is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
switch (true) {
/* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors:
Expand Down

0 comments on commit df1203f

Please sign in to comment.