Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#48283 closed defect (bug) (fixed)

Cron: 'Headers already sent' warning with `ALTERNATE_WP_CRON`

Reported by: dlh Owned by: jorbin
Priority: normal Milestone: 5.3
Component: Cron API Version: 5.3
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

After [45560], a "Headers already sent" warning is generated when ALTERNATE_WP_CRON is enabled. The cause seems to be that spawn_cron() adds headers via wp_redirect() and then sends headers before loading wp-cron.php.

The attached patch would add a headers_sent() check before the two caching headers.

Attachments (1)

48283.diff (648 bytes ) - added by dlh 7 years ago.

Download all attachments as: .zip

Change History (3)

@dlh
7 years ago

#1 @jorbin
7 years ago

  • Milestone Awaiting Review5.3

#2 @jorbin
7 years ago

  • Owner set to jorbin
  • Resolutionfixed
  • Status newclosed

In 46458:

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.

Note: See TracTickets for help on using tickets.