- Timestamp:
- 02/16/2022 09:17:04 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/random_bytes_mcrypt.php
r46586 r52742 1 1 <?php 2 2 /** 3 * Random_* Compatibility Library 3 * Random_* Compatibility Library 4 4 * for using the new PHP 7 random_* API in PHP 5 projects 5 * 5 * 6 6 * The MIT License (MIT) 7 7 * 8 * Copyright (c) 2015 - 201 7Paragon Initiative Enterprises9 * 8 * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises 9 * 10 10 * Permission is hereby granted, free of charge, to any person obtaining a copy 11 11 * of this software and associated documentation files (the "Software"), to deal … … 14 14 * copies of the Software, and to permit persons to whom the Software is 15 15 * furnished to do so, subject to the following conditions: 16 * 16 * 17 17 * The above copyright notice and this permission notice shall be included in 18 18 * all copies or substantial portions of the Software. 19 * 19 * 20 20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, … … 43 43 { 44 44 try { 45 /** @var int $bytes */ 45 46 $bytes = RandomCompat_intval($bytes); 46 47 } catch (TypeError $ex) { … … 56 57 } 57 58 58 $buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM); 59 /** @var string|bool $buf */ 60 $buf = @mcrypt_create_iv((int) $bytes, (int) MCRYPT_DEV_URANDOM); 59 61 if ( 60 $buf !== false61 &&62 is_string($buf) 63 && 62 64 RandomCompat_strlen($buf) === $bytes 63 65 ) {
Note: See TracChangeset
for help on using the changeset viewer.