mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-22 05:51:20 +01:00
Use !empty('0') instead of strlen('0')
Thanks petrich!
This commit is contained in:
parent
aa3da09747
commit
9b4240c104
@ -597,7 +597,7 @@ class Crypt_DES {
|
||||
}
|
||||
break;
|
||||
case CRYPT_DES_MODE_CFB:
|
||||
if (!empty($buffer['xor'])) {
|
||||
if (strlen($buffer['xor'])) {
|
||||
$ciphertext = $plaintext ^ $buffer['xor'];
|
||||
$iv = $buffer['encrypted'] . $ciphertext;
|
||||
$start = strlen($ciphertext);
|
||||
|
@ -763,7 +763,7 @@ class Crypt_Rijndael {
|
||||
}
|
||||
break;
|
||||
case CRYPT_RIJNDAEL_MODE_CFB:
|
||||
if (!empty($buffer['xor'])) {
|
||||
if (strlen($buffer['xor'])) {
|
||||
$ciphertext = $plaintext ^ $buffer['xor'];
|
||||
$iv = $buffer['encrypted'] . $ciphertext;
|
||||
$start = strlen($ciphertext);
|
||||
|
@ -617,7 +617,7 @@ class Crypt_TripleDES {
|
||||
}
|
||||
break;
|
||||
case CRYPT_DES_MODE_CFB:
|
||||
if (!empty($buffer['xor'])) {
|
||||
if (strlen($buffer['xor'])) {
|
||||
$ciphertext = $plaintext ^ $buffer['xor'];
|
||||
$iv = $buffer['encrypted'] . $ciphertext;
|
||||
$start = strlen($ciphertext);
|
||||
|
@ -302,7 +302,7 @@ class Math_BigInteger {
|
||||
}
|
||||
|
||||
// '0' counts as empty() but when the base is 256 '0' is equal to ord('0') or 48
|
||||
// '0' is the only value like this per http://php.net/empty
|
||||
// '0' is the only value like this per http://php.net/empty
|
||||
if (empty($x) && (abs($base) != 256 || $x !== '0')) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user