Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.756.2.24 diff -u -u -p -r1.756.2.24 common.inc --- includes/common.inc 13 Aug 2008 23:59:12 -0000 1.756.2.24 +++ includes/common.inc 25 Aug 2008 14:20:53 -0000 @@ -294,6 +294,10 @@ function drupal_get_destination() { * @see drupal_get_destination() */ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302) { + // Ignore drupal_goto's within cron.php. + if (drupal_get_cron()) { + return; + } if (isset($_REQUEST['destination'])) { extract(parse_url(urldecode($_REQUEST['destination']))); @@ -2505,6 +2509,18 @@ function page_set_cache() { } /** + * Get/Set a status variable indicating that this is the cron page. + */ +function drupal_get_cron($set = NULL) { + static $cron = FALSE; + + if (!is_null($set)) { + $cron = $set; + } + return $cron; +} + +/** * Executes a cron run when called * @return * Returns TRUE if ran successfully @@ -2536,6 +2552,9 @@ function drupal_cron_run() { // Register shutdown callback register_shutdown_function('drupal_cron_cleanup'); + // Set a status variable indicating that this is the cron page. + drupal_get_cron(TRUE); + // Lock cron semaphore variable_set('cron_semaphore', time());