You are here

function html_title_preprocess_page in HTML Title 7

Same name and namespace in other branches
  1. 6 html_title.module \html_title_preprocess_page()

Implementation of hook_preprocess_page()

File

./html_title.module, line 59
This module enables limited HTML to be used in node titles. It strips title markup from RSS feeds to eliminate unsightly markup in feed readers.

Code

function html_title_preprocess_page(&$vars) {

  // Only edit the title on /node/%node.
  if (array_key_exists('node', $vars) && node_is_page($vars['node']) && empty(arg(2))) {

    // Reset title to allow safe HTML
    $vars['title'] = html_title_filter_xss($vars['node']->title);

    // Strip HTML from head title
    $vars['head_title'] = strip_tags($vars['node']->title);
    drupal_set_title($vars['head_title']);
  }
}