Changeset 36220
- Timestamp:
- 01/08/2016 03:27:58 AM (9 years ago)
- Location:
- trunk/src/wp-includes/random_compat
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/random.php
r35922 r36220 59 59 if (extension_loaded('libsodium')) { 60 60 // See random_bytes_libsodium.php 61 require_once $RandomCompatDIR.'/random_bytes_libsodium.php'; 61 if (PHP_VERSION_ID >= 50300 && function_exists('\\Sodium\\randombytes_buf')) { 62 require_once $RandomCompatDIR.'/random_bytes_libsodium.php'; 63 } elseif (method_exists('Sodium', 'randombytes_buf')) { 64 require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php'; 65 } 62 66 } 63 67 if ( … … 76 80 77 81 // See random_bytes_dev_urandom.php 78 require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';79 }82 require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php'; 83 } 80 84 if ( 81 85 !function_exists('random_bytes') && -
trunk/src/wp-includes/random_compat/random_bytes_libsodium_legacy.php
r36182 r36220 64 64 ? 1073741824 65 65 : $bytes - $i; 66 $buf .= \Sodium\randombytes_buf($n);66 $buf .= Sodium::randombytes_buf($n); 67 67 } 68 68 } else { 69 $buf = \Sodium\randombytes_buf($bytes);69 $buf = Sodium::randombytes_buf($bytes); 70 70 } 71 71
Note: See TracChangeset
for help on using the changeset viewer.