You are here

function favicon_shortcut_icon in Favicon 7

Same name and namespace in other branches
  1. 5 favicon.module \favicon_shortcut_icon()
  2. 6 favicon.module \favicon_shortcut_icon()

Menu callback; forwards to the favicon.

2 string references to 'favicon_shortcut_icon'
FaviconTestCase::testMenu in ./favicon.test
Test the return of the hook_menu function.
favicon_menu in ./favicon.module
Implements hook_menu().

File

./favicon.module, line 25
Module file for favicon module.

Code

function favicon_shortcut_icon() {
  $file_details = _favicon_get_favicon_file();
  if (empty($file_details)) {
    drupal_not_found();
  }
  header('Content-Type: ' . $file_details['mime']);
  header('Expires: 0');

  // The readfile function is disabled on some hosting providers.
  $handle = fopen($file_details['path'], 'rb');
  if ($handle !== false) {
    fpassthru($handle);
    fclose($handle);
  }
  drupal_exit();
}