Changeset 36058
- Timestamp:
- 12/22/2015 03:22:05 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/random_compat/random.php
r35600 r36058 91 91 class_exists('COM') 92 92 ) { 93 try { 94 $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); 95 if (method_exists($RandomCompatCOMtest, 'GetRandom')) { 96 // See random_bytes_com_dotnet.php 97 require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php'; 93 $RandomCompat_disabled_classes = preg_split( 94 '#\s*,\s*#', 95 strtolower(ini_get('disable_classes')) 96 ); 97 98 if (!in_array('com', $RandomCompat_disabled_classes)) { 99 try { 100 $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); 101 if (method_exists($RandomCompatCOMtest, 'GetRandom')) { 102 // See random_bytes_com_dotnet.php 103 require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php'; 104 } 105 } catch (com_exception $e) { 106 // Don't try to use it. 98 107 } 99 } catch (com_exception $e) {100 // Don't try to use it.101 108 } 109 $RandomCompat_disabled_classes = null; 102 110 $RandomCompatCOMtest = null; 103 111 } -
branches/4.4/src/wp-includes/random_compat/random_bytes_dev_urandom.php
r35600 r36058 63 63 } 64 64 } 65 /** 66 * stream_set_read_buffer() does not exist in HHVM 67 * 68 * If we don't set the stream's read buffer to 0, PHP will 69 * internally buffer 8192 bytes, which can waste entropy 70 * 71 * stream_set_read_buffer returns 0 on success 72 */ 73 if (!empty($fp) && function_exists('stream_set_read_buffer')) { 74 stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); 65 if (!empty($fp)) { 66 /** 67 * stream_set_read_buffer() does not exist in HHVM 68 * 69 * If we don't set the stream's read buffer to 0, PHP will 70 * internally buffer 8192 bytes, which can waste entropy 71 * 72 * stream_set_read_buffer returns 0 on success 73 */ 74 if (function_exists('stream_set_read_buffer')) { 75 stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); 76 } 77 if (function_exists('stream_set_chunk_size')) { 78 stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER); 79 } 75 80 } 76 81 }
Note: See TracChangeset
for help on using the changeset viewer.