Skip to content

Commit dd3b205

Browse files
committed
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. Built from https://develop.svn.wordpress.org/trunk@56553 git-svn-id: https://core.svn.wordpress.org/trunk@56065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent dd657e6 commit dd3b205

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

wp-includes/cron.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ function spawn_cron( $gmt_time = 0 ) {
863863
* Multiple processes on multiple web servers can run this code concurrently,
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 ) {
869869
$lock = 0;

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.4-alpha-56552';
19+
$wp_version = '6.4-alpha-56553';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)