WordPress.org

Make WordPress Core

Ticket #16753: 16753.patch

File 16753.patch, 3.0 KB (added by hakre, 7 years ago)
  • wp-content/plugins/akismet/akismet.php

     
    202202}
    203203
    204204function akismet_microtime() {
    205         $mtime = explode( ' ', microtime() );
    206         return $mtime[1] + $mtime[0];
     205        return microtime( true );
    207206}
    208207
    209208// log an event for a given comment, storing it in comment_meta
  • wp-includes/formatting.php

     
    12831283 */
    12841284function antispambot($emailaddy, $mailto=0) {
    12851285        $emailNOSPAMaddy = '';
    1286         srand ((float) microtime() * 1000000);
    12871286        for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) {
    12881287                $j = floor(rand(0, 1+$mailto));
    12891288                if ($j==0) {
  • wp-includes/load.php

     
    186186 */
    187187function timer_start() {
    188188        global $timestart;
    189         $mtime = explode( ' ', microtime() );
    190         $timestart = $mtime[1] + $mtime[0];
     189        $timestart = microtime( true );
    191190        return true;
    192191}
    193192
     
    217216 */
    218217function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal
    219218        global $timestart, $timeend;
    220         $mtime = microtime();
    221         $mtime = explode( ' ', $mtime );
    222         $timeend = $mtime[1] + $mtime[0];
     219        $timeend = microtime( true );
    223220        $timetotal = $timeend - $timestart;
    224221        $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );
    225222        if ( $display )
  • wp-includes/pluggable.php

     
    15551555                        static $seed = '';
    15561556                else
    15571557                        $seed = get_transient('random_seed');
    1558                 $rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
     1558                $rnd_value = md5( uniqid( NULL, true ) . $seed );
    15591559                $rnd_value .= sha1($rnd_value);
    15601560                $rnd_value .= sha1($rnd_value . $seed);
    15611561                $seed = md5($seed . $rnd_value);
  • wp-includes/wp-db.php

     
    14441444         * @return true
    14451445         */
    14461446        function timer_start() {
    1447                 $mtime            = explode( ' ', microtime() );
    1448                 $this->time_start = $mtime[1] + $mtime[0];
     1447                $this->time_start = microtime( true );
    14491448                return true;
    14501449        }
    14511450
     
    14571456         * @return int Total time spent on the query, in milliseconds
    14581457         */
    14591458        function timer_stop() {
    1460                 $mtime      = explode( ' ', microtime() );
    1461                 $time_end   = $mtime[1] + $mtime[0];
    1462                 $time_total = $time_end - $this->time_start;
    1463                 return $time_total;
     1459                $time_total = microtime( true ) - $this->time_start;
     1460                return (int) $time_total;
    14641461        }
    14651462
    14661463        /**