You are here

function rules_drupal_goto_alter in Rules 7.2

Implements hook_drupal_goto_alter().

See also

rules_action_drupal_goto()

File

./rules.module, line 1413
Rules engine module.

Code

function rules_drupal_goto_alter(&$path, &$options, &$http_response_code) {

  // Invoke a the page redirect, in case the action has been executed.
  if (isset($GLOBALS['_rules_action_drupal_goto_do'])) {
    list($url, $force) = $GLOBALS['_rules_action_drupal_goto_do'];
    if ($force || !isset($_GET['destination'])) {
      $url = drupal_parse_url($url);
      $path = $url['path'];
      $options['query'] = $url['query'];
      $options['fragment'] = $url['fragment'];
      $http_response_code = 302;
    }
  }
}