Make WordPress Core


Ignore:
Timestamp:
08/06/2008 08:31:54 PM (16 years ago)
Author:
markjaquith
Message:

Cast to array when using foreach(). Props santosj (and thanks for your perseverance!). fixes #2784

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cron.php

    r8537 r8572  
    111111    foreach ( $crons as $timestamp => $cronhooks ) {
    112112        if ( $timestamp > time() ) break;
    113         foreach ( $cronhooks as $hook => $args ) {
     113        foreach ( (array) $cronhooks as $hook => $args ) {
    114114            if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
    115115                continue;
     
    169169    $new_cron = array();
    170170
    171     foreach ($cron as $timestamp => $hooks) {
    172         foreach ( $hooks as $hook => $args ) {
     171    foreach ( (array) $cron as $timestamp => $hooks) {
     172        foreach ( (array) $hooks as $hook => $args ) {
    173173            $key = md5(serialize($args['args']));
    174174            $new_cron[$timestamp][$hook][$key] = $args;
Note: See TracChangeset for help on using the changeset viewer.