Changeset 54310 for trunk/src/wp-includes/sodium_compat/src/Compat.php
- Timestamp:
- 09/26/2022 01:58:53 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/Compat.php
r54150 r54310 3220 3220 * 3221 3221 * @param string $string Hexadecimal string 3222 * @param string $ignore List of characters to ignore; useful for whitespace 3222 3223 * @return string Raw binary string 3223 3224 * @throws SodiumException … … 3226 3227 * @psalm-suppress MixedArgument 3227 3228 */ 3228 public static function hex2bin($string )3229 public static function hex2bin($string, $ignore = '') 3229 3230 { 3230 3231 /* Type checks: */ 3231 3232 ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); 3233 ParagonIE_Sodium_Core_Util::declareScalarType($ignore, 'string', 2); 3232 3234 3233 3235 if (self::useNewSodiumAPI()) { 3234 3236 if (is_callable('sodium_hex2bin')) { 3235 return (string) sodium_hex2bin($string );3237 return (string) sodium_hex2bin($string, $ignore); 3236 3238 } 3237 3239 } 3238 3240 if (self::use_fallback('hex2bin')) { 3239 return (string) call_user_func('\\Sodium\\hex2bin', $string );3240 } 3241 return ParagonIE_Sodium_Core_Util::hex2bin($string );3241 return (string) call_user_func('\\Sodium\\hex2bin', $string, $ignore); 3242 } 3243 return ParagonIE_Sodium_Core_Util::hex2bin($string, $ignore); 3242 3244 } 3243 3245
Note: See TracChangeset
for help on using the changeset viewer.