Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/20/2026 07:23:16 PM (5 months ago)
Author:
johnjamesjacoby
Message:

Extend - Akismet: store time() in history events instead of microtime() float.

Fixes the PHP 8.1+ Implicit conversion from float to int loses precision deprecation notice, emitted every time the Akismet history metabox renders for a topic or reply.

In trunk, for 2.7.

Props dd32.

Fixes: #3671.

From: ​https://github.com/bbpress/bbPress/pull/43

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/akismet.php

    r7386 r7408  
    729729                }
    730730
    731                 // This used to be akismet_microtime() but it was removed in 3.0
    732                 $mtime        = explode( ' ', microtime() );
    733                 $message_time = $mtime[1] + $mtime[0];
    734 
    735731                // Setup the event to be saved
    736732                $event = array(
    737                         'time'    => $message_time,
     733                        'time'    => time(),
    738734                        'message' => $message,
    739735                        'event'   => $event,
    … …  
    996992                                                        <tr>
    997993                                                                <td style="color: #999; text-align: right; white-space: nowrap;">
    998                                                                         <span title="<?php echo esc_attr( gmdate( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT' ); ?>">
    999                                                                                 <?php bbp_time_since( $row['time'], false, true ); ?>
     994                                                                        <span title="<?php echo esc_attr( gmdate( 'D d M Y @ h:i:m a', (int) $row['time'] ) . ' GMT' ); ?>">
     995                                                                                <?php bbp_time_since( (int) $row['time'], false, true ); ?>
    1000996                                                                        </span>
    1001997                                                                </td>
Note: See TracChangeset for help on using the changeset viewer.