WordPress.org

Make WordPress Core

Ticket #10727: 10727.3.patch

File 10727.3.patch, 1.1 KB (added by hakre, 6 years ago)

Updated for compability reasons

  • wp-includes/class-phpass.php

     
    33 * Portable PHP password hashing framework. 
    44 * @package phpass 
    55 * @since 2.5 
    6  * @version 0.1 
     6 * @version 0.2 / genuine. 
    77 * @link http://www.openwall.com/phpass/ 
    88 */ 
    99 
     
    2929 * Portable PHP password hashing framework. 
    3030 * 
    3131 * @package phpass 
    32  * @version 0.1 / genuine 
     32 * @version 0.2 / genuine. 
    3333 * @link http://www.openwall.com/phpass/ 
    3434 * @since 2.5 
    3535 */ 
     
    4949 
    5050                $this->portable_hashes = $portable_hashes; 
    5151 
    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 
    5453        } 
    5554 
    5655        function get_random_bytes($count) 
    5756        { 
    5857                $output = ''; 
    59                 if (($fh = @fopen('/dev/urandom', 'rb'))) { 
     58                if (is_readable('/dev/urandom') && 
     59                    ($fh = @fopen('/dev/urandom', 'rb'))) { 
    6060                        $output = fread($fh, $count); 
    6161                        fclose($fh); 
    6262                }