You are here

public static function DeliveryHelper::deliverRedirect in Helper 7

1 call to DeliveryHelper::deliverRedirect()
DeliveryHelper::deliverFileRedirect in lib/DeliveryHelper.php

File

lib/DeliveryHelper.php, line 56

Class

DeliveryHelper

Code

public static function deliverRedirect($result) {
  if (is_int($result)) {
    drupal_deliver_html_page($result);
    return;
  }
  if (module_exists('redirect')) {

    // Using the redirect module instead of drupal_goto() may allow this
    // redirect to be stored in the page cache.
    $redirect = new stdClass();
    $redirect->redirect = $result;
    redirect_redirect($redirect);
  }
  else {
    drupal_goto($result, array(), 301);
  }
}