Cron: Prevent sending headers when using ALTERNATE_WP_CRON

ALTERNATE_WP_CRON echos things which causes a "Headers already sent" warning. This adds a check to ensure headers haven't already been sent.

Previously: [45560]

See: #45560. Fixes #48283.
Props dlh.


Built from https://develop.svn.wordpress.org/trunk@46458


git-svn-id: http://core.svn.wordpress.org/trunk@46256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2019-10-10 22:52:03 +00:00
parent c621d4fb3f
commit 742537ac3d
2 changed files with 6 additions and 3 deletions

View File

@ -20,8 +20,11 @@ ignore_user_abort( true );
/* Don't make the request block till we finish, if possible. */
if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
if ( ! headers_sent() ) {
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
}
fastcgi_finish_request();
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-beta3-46457';
$wp_version = '5.3-beta3-46458';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.