Make WordPress Core

Changeset 56553


Ignore:
Timestamp:
09/11/2023 05:25:41 AM (13 months ago)
Author:
peterwilsoncc
Message:

Cron: Cast doing_cron transient to a float.

Cast the doing_cron transient value to a float to prevent type errors if the transient is not set (in which case it returns false) or another unexpected type.

Props fzhantw, ankitmaru.
Fixes #58471.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cron.php

    r56414 r56553  
    864864     * this lock attempts to make spawning as atomic as possible.
    865865     */
    866     $lock = get_transient( 'doing_cron' );
     866    $lock = (float) get_transient( 'doing_cron' );
    867867
    868868    if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS ) {
Note: See TracChangeset for help on using the changeset viewer.