You are here

function elf_redirect in External Links Filter 7.3

Same name and namespace in other branches
  1. 6.3 elf.module \elf_redirect()

Redirect the browser to the external URL from $_GET['url'].

3 string references to 'elf_redirect'
elf_form_settings in ./elf.module
Admin settings form.
elf_menu in ./elf.module
Implement hook_menu().
elf_replace in ./elf.module
Hook_filter_info() process callback.

File

./elf.module, line 201
Adds an icon to external and mailto links.

Code

function elf_redirect() {
  $url = !empty($_GET['url']) ? $_GET['url'] : '';
  $key = !empty($_GET['key']) ? $_GET['key'] : '';
  if (!$url) {
    elf_redirect_exit();
  }

  // Works as a broken link if no valid arguments found.
  $parsed_url = drupal_parse_url(elf_get_redirect_url($url));
  if ($key != $parsed_url['query']['key']) {
    elf_redirect_exit();
  }

  // Perform the redirection to the external URL.
  drupal_goto($url);
}