You are here

function fontdeck_get_domain in @font-your-face 7.2

Helper function - gets the correct domain for authentication with Fontdeck.

2 calls to fontdeck_get_domain()
fontdeck_fontyourface_import in modules/fontdeck/fontdeck.module
Implements hook_fontyourface_import().
fontdeck_preprocess_html in modules/fontdeck/fontdeck.module
Implements template_preprocess_html().

File

modules/fontdeck/fontdeck.module, line 215

Code

function fontdeck_get_domain() {

  // We attempt to parse it as an URL, looking mainly to strip non-standard
  // port numbers. If it does not parse, it is obviously simple enought to be
  // used as it is.
  $details = parse_url($_SERVER['HTTP_HOST']);
  $host = isset($details['host']) ? $details['host'] : $_SERVER['HTTP_HOST'];
  return preg_replace('#^www.#', '', $host);
}