function rules_drupal_goto_alter

Implements hook_drupal_goto_alter().

See also

rules_action_drupal_goto()

File

./rules.module, line 1445

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;
        }
    }
}