Ticket #2425: 2425.diff

File 2425.diff, 1.6 KB (added by mdawaffe, 6 years ago)

md5 check, don't need time (do we?), typo

  • wp-includes/cron.php

     
    4949} 
    5050 
    5151function wp_clear_scheduled_hook($hook) { 
    52         while($timestamp = next_scheduled($hook)) 
     52        while($timestamp = wp_next_scheduled($hook)) 
    5353                wp_unschedule_event($timestamp, $hook); 
    5454} 
    5555 
     
    7272         
    7373        $argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01); 
    7474        if ( $argyle ) 
    75                 fputs($argyle, "GET {$parts['path']}?time=" . time() . '&check=' 
    76                 . md5(DB_PASS . '187425') . " HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n"); 
     75                fputs($argyle, 
     76                          "GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n" 
     77                        . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n" 
     78                ); 
    7779} 
    7880 
    7981function wp_cron() { 
     
    100102        ); 
    101103        return array_merge(apply_filters('cron_schedules', array()), $schedules); 
    102104} 
    103 ?> 
    104  No newline at end of file 
     105?> 
  • wp-cron.php

     
    33define('DOING_CRON', TRUE); 
    44require_once('wp-config.php'); 
    55 
     6if ( $_GET['check'] != md5(DB_PASS . '187425') ) 
     7        exit; 
     8 
    69$crons = get_option('cron'); 
    710if (!is_array($crons) || array_shift(array_keys($crons)) > time()) 
    811        return; 
     
    1215                do_action($hook, $args['args']); 
    1316                $schedule = $args['schedule']; 
    1417                if($schedule != false) { 
    15                         fwrite($fp, var_export($schedules[$schedule])); 
    1618                        $args = array_merge( array($timestamp, $schedule, $hook), $args['args']); 
    1719                        call_user_func_array('wp_reschedule_event', $args); 
    1820                }