Ticket #12609: 12609.diff
File 12609.diff, 2.2 KB (added by , 15 years ago) |
---|
-
wp-includes/cron.php
177 177 if ( !$local_time ) 178 178 $local_time = time(); 179 179 180 if ( defined( 'DOING_CRON') || isset($_GET['doing_wp_cron']) )180 if ( defined( 'DOING_CRON' ) || isset( $_GET['doing_wp_cron'] ) ) 181 181 return; 182 182 183 183 /* … … 185 185 * such as due to power failure, or misconfiguration 186 186 */ 187 187 $timer_accurate = check_server_timer( $local_time ); 188 if ( ! $timer_accurate )188 if ( ! $timer_accurate ) 189 189 return; 190 190 191 191 /* 192 192 * multiple processes on multiple web servers can run this code concurrently 193 193 * try to make this as atomic as possible by setting doing_cron switch 194 194 */ 195 $flag = get_transient( 'doing_cron');195 $flag = get_transient( 'doing_cron' ); 196 196 197 197 if ( $flag > $local_time + 10*60 ) 198 198 $flag = 0; … … 203 203 204 204 //sanity check 205 205 $crons = _get_cron_array(); 206 if ( ! is_array($crons) )206 if ( ! is_array( $crons ) ) 207 207 return; 208 208 209 209 $keys = array_keys( $crons ); 210 if ( isset( $keys[0]) && $keys[0] > $local_time )210 if ( isset( $keys[0] ) && $keys[0] > $local_time ) 211 211 return; 212 212 213 if ( defined( 'ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {214 if ( ! empty($_POST) || defined('DOING_AJAX') )213 if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { 214 if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) ) 215 215 return; 216 216 217 217 set_transient( 'doing_cron', $local_time ); 218 218 219 219 ob_start(); 220 wp_redirect( add_query_arg( 'doing_wp_cron', '', stripslashes($_SERVER['REQUEST_URI'])) );220 wp_redirect( add_query_arg( 'doing_wp_cron', '', stripslashes( $_SERVER['REQUEST_URI'] ) ) ); 221 221 echo ' '; 222 222 223 223 // flush any buffers and send the headers 224 224 while ( @ob_end_flush() ); 225 225 flush(); 226 226 227 @include_once( ABSPATH . 'wp-cron.php');227 @include_once( ABSPATH . 'wp-cron.php' ); 228 228 return; 229 229 } 230 230 231 231 set_transient( 'doing_cron', $local_time ); 232 232 233 233 $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron'; 234 wp_remote_ post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );234 wp_remote_head( $cron_url, array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', false ) ) ); 235 235 } 236 236 237 237 /**