Changeset 52742 for trunk/src/wp-includes/random_compat/random.php
- 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.php
r46586 r52742 4 4 * for using the new PHP 7 random_* API in PHP 5 projects 5 5 * 6 * @version 2.0.1 07 * @released 201 7-03-136 * @version 2.0.17 7 * @released 2018-07-04 8 8 * 9 9 * The MIT License (MIT) 10 10 * 11 * Copyright (c) 2015 - 201 7Paragon Initiative Enterprises11 * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises 12 12 * 13 13 * Permission is hereby granted, free of charge, to any person obtaining a copy … … 55 55 $RandomCompatDIR = dirname(__FILE__); 56 56 57 require_once $RandomCompatDIR . '/byte_safe_strings.php';58 require_once $RandomCompatDIR . '/cast_to_int.php';59 require_once $RandomCompatDIR . '/error_polyfill.php';57 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'byte_safe_strings.php'; 58 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'cast_to_int.php'; 59 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'error_polyfill.php'; 60 60 61 61 if (!is_callable('random_bytes')) { … … 77 77 // See random_bytes_libsodium.php 78 78 if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) { 79 require_once $RandomCompatDIR . '/random_bytes_libsodium.php';79 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_libsodium.php'; 80 80 } elseif (method_exists('Sodium', 'randombytes_buf')) { 81 require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php';81 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_libsodium_legacy.php'; 82 82 } 83 83 } … … 118 118 119 119 // See random_bytes_dev_urandom.php 120 require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php';120 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_dev_urandom.php'; 121 121 } 122 122 // Unset variables after use … … 160 160 ) { 161 161 // See random_bytes_mcrypt.php 162 require_once $RandomCompatDIR . '/random_bytes_mcrypt.php';162 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_mcrypt.php'; 163 163 } 164 164 $RandomCompatUrandom = null; … … 183 183 try { 184 184 $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); 185 if (method_exists($RandomCompatCOMtest, 'GetRandom')) { 185 /** @psalm-suppress TypeDoesNotContainType */ 186 if (is_callable(array($RandomCompatCOMtest, 'GetRandom'))) { 186 187 // See random_bytes_com_dotnet.php 187 require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php';188 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_com_dotnet.php'; 188 189 } 189 190 } catch (com_exception $e) { … … 204 205 * 205 206 * @param mixed $length 206 * @ return void207 * @psalm-suppress InvalidReturnType 207 208 * @throws Exception 209 * @return string 208 210 */ 209 211 function random_bytes($length) … … 213 215 'There is no suitable CSPRNG installed on your system' 214 216 ); 217 return ''; 215 218 } 216 219 } … … 218 221 219 222 if (!is_callable('random_int')) { 220 require_once $RandomCompatDIR . '/random_int.php';223 require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_int.php'; 221 224 } 222 225
Note: See TracChangeset
for help on using the changeset viewer.