I use gotwo module to link to external sites but they are not detected as external since they are internal but redirecting to external.
It would be nice to add a list of URL prefixes to force those to be treated as external..
As an example... all internal url's starting with "/go/"

Comments

hedac’s picture

well I did a quick dirty fix to the code for my needs, marking the URL's with /go/ as external

/**
 * Test if a URL is external
 *
 * URL's with /go/ are also considered external
 * @param $url string
 */
function elf_url_external($url) {
  global $base_url;
  static $domains = array();

  if (!$domains) {
    $domains = array_merge(variable_get('elf_domains', array()), array($base_url));
  }

  foreach ($domains as $domain) {
    if (strpos($url, $domain) === 0) {
      return FALSE;
    }
  }
  if (strpos($url, "/go/") === 0) {
    return TRUE;
  }
  return menu_path_is_external($url);
}
xano’s picture

Status: Active » Postponed

That fix is too dirty to be committed. No offense, but it is too particular a workaround.

Note that ELF now has it's own goto redirect as well: #770628: Goto redirect.

WorldFallz’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

agree with xano. No go without a clean generic patch.