Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#29077 closed defect (bug) (fixed)

Undefined index notice in wp_reschedule_event()

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Cron API Keywords: good-first-bug has-patch
Focuses: Cc:


Previously: #22268

If you have a custom cron schedule defined by a plugin, and a recurring event attached to it, you'll get a notice if the plugin is no longer available:

PHP Notice: Undefined index: minutely in wp-includes/cron.php on line 111

The notice comes from wp_reschedule_event(): tags/3.9.1/src/wp-includes/cron.php#L92.

In line 110, we should replace redundant 0 == $interval check with isset( $schedules[ $recurrence ] ).

Attachments (2)

29077.patch (1019 bytes) - added by paulschreiber 9 years ago.
29077.2.patch (1007 bytes) - added by paulschreiber 9 years ago.
patch with correct indentation

Download all attachments as: .zip

Change History (5)

9 years ago

#1 @paulschreiber
9 years ago

  • Keywords has-patch added; needs-patch removed

9 years ago

patch with correct indentation

#2 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 29349:

Avoid an undefined index notice in wp_reschedule_event().

props paulschreiber.
fixes #29077.

#3 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.0
Note: See TracTickets for help on using tickets.