Ticket #10727: 10727.3.patch
File 10727.3.patch, 1.1 KB (added by , 15 years ago) |
---|
-
wp-includes/class-phpass.php
3 3 * Portable PHP password hashing framework. 4 4 * @package phpass 5 5 * @since 2.5 6 * @version 0. 16 * @version 0.2 / genuine. 7 7 * @link http://www.openwall.com/phpass/ 8 8 */ 9 9 … … 29 29 * Portable PHP password hashing framework. 30 30 * 31 31 * @package phpass 32 * @version 0. 1 / genuine32 * @version 0.2 / genuine. 33 33 * @link http://www.openwall.com/phpass/ 34 34 * @since 2.5 35 35 */ … … 49 49 50 50 $this->portable_hashes = $portable_hashes; 51 51 52 $this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE); 53 52 $this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compability reasons 54 53 } 55 54 56 55 function get_random_bytes($count) 57 56 { 58 57 $output = ''; 59 if (($fh = @fopen('/dev/urandom', 'rb'))) { 58 if (is_readable('/dev/urandom') && 59 ($fh = @fopen('/dev/urandom', 'rb'))) { 60 60 $output = fread($fh, $count); 61 61 fclose($fh); 62 62 }