[wp-trac] [WordPress Trac] #51196: PHP warning at every pageload form cron

WordPress Trac noreply at wordpress.org
Mon Aug 31 08:24:56 UTC 2020


#51196: PHP warning at every pageload form cron
--------------------------+-----------------------------
 Reporter:  opajaap       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.5
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 Under some circumstances `$cronhooks` on line 117 of wp-cron.php may be
 `false`.
 This results in php warnings at every pageload:

 `[Fri Aug 28 21:15:16.443167 2020] [fcgid:warn] [pid 62430] [client
 77.68.64.25:32953] mod_fcgid: stderr: PHP Warning:  Invalid argument
 supplied for foreach() in /home/domains/vol3/578/2510578/user/htdocs/wp-
 cron.php on line 117, referer: https://www.pakohl.com/wp-
 cron.php?doing_wp_cron=1598645713.5858569145202636718750`

 Suggested fix:

 Change
 `foreach ( $cronhooks as $hook => $keys ) {`

 into
 `if ( is_array( $cronhooks ) ) foreach ( $cronhooks as $hook => $keys ) {`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51196>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list