Changeset 35410
- Timestamp:
- 10/28/2015 01:11:57 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/random.php
r35365 r35410 31 31 $RandomCompatversion = explode('.', PHP_VERSION); 32 32 define('PHP_VERSION_ID', ($RandomCompatversion[0] * 10000 + $RandomCompatversion[1] * 100 + $RandomCompatversion[2])); 33 unset($RandomCompatversion);33 $RandomCompatversion = null; 34 34 } 35 35 if (PHP_VERSION_ID < 70000) { … … 37 37 define('RANDOM_COMPAT_READ_BUFFER', 8); 38 38 } 39 $ __DIR__= dirname(__FILE__);40 require_once $ __DIR__.'/byte_safe_strings.php';41 require_once $ __DIR__.'/cast_to_int.php';42 require_once $ __DIR__.'/error_polyfill.php';39 $RandomCompatDIR = dirname(__FILE__); 40 require_once $RandomCompatDIR.'/byte_safe_strings.php'; 41 require_once $RandomCompatDIR.'/cast_to_int.php'; 42 require_once $RandomCompatDIR.'/error_polyfill.php'; 43 43 if (!function_exists('random_bytes')) { 44 44 /** … … 59 59 if (extension_loaded('libsodium')) { 60 60 // See random_bytes_libsodium.php 61 require_once $ __DIR__.'/random_bytes_libsodium.php';61 require_once $RandomCompatDIR.'/random_bytes_libsodium.php'; 62 62 } 63 63 if ( … … 76 76 77 77 // See random_bytes_dev_urandom.php 78 require_once $ __DIR__.'/random_bytes_dev_urandom.php';78 require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php'; 79 79 } 80 80 if ( … … 84 84 ) { 85 85 // See random_bytes_mcrypt.php 86 require_once $ __DIR__.'/random_bytes_mcrypt.php';86 require_once $RandomCompatDIR.'/random_bytes_mcrypt.php'; 87 87 } 88 88 if ( … … 95 95 if (method_exists($RandomCompatCOMtest, 'GetRandom')) { 96 96 // See random_bytes_com_dotnet.php 97 require_once $ __DIR__.'/random_bytes_com_dotnet.php';97 require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php'; 98 98 } 99 99 } catch (com_exception $e) { 100 100 // Don't try to use it. 101 101 } 102 unset($RandomCompatCOMtest);102 $RandomCompatCOMtest = null; 103 103 } 104 104 if ( 105 105 !function_exists('random_bytes') && 106 106 extension_loaded('openssl') && 107 PHP_VERSION_ID >= 50300 107 ( 108 // Unix-like with PHP >= 5.3.0 or 109 ( 110 DIRECTORY_SEPARATOR === '/' && 111 PHP_VERSION_ID >= 50300 112 ) || 113 // Windows with PHP >= 5.3.4 114 PHP_VERSION_ID >= 50304 115 ) 108 116 ) { 109 117 // See random_bytes_openssl.php 110 require_once $ __DIR__.'/random_bytes_openssl.php';118 require_once $RandomCompatDIR.'/random_bytes_openssl.php'; 111 119 } 112 120 if (!function_exists('random_bytes')) { … … 124 132 } 125 133 if (!function_exists('random_int')) { 126 require_once $ __DIR__.'/random_int.php';134 require_once $RandomCompatDIR.'/random_int.php'; 127 135 } 128 unset($__DIR__);136 $RandomCompatDIR = null; 129 137 }
Note: See TracChangeset
for help on using the changeset viewer.