1 common.inc _backdrop_default_html_head()

Returns elements that are always displayed in the HEAD tag of the HTML page.

File

core/includes/common.inc, line 386
Common functions that many Backdrop modules will need to reference.

Code

function _backdrop_default_html_head() {
  // Add default elements. Make sure the Content-Type comes first because the
  // IE browser may be vulnerable to XSS via encoding attacks from any content
  // that comes before this META tag, such as a TITLE tag.
  $elements['system_meta_content_type'] = array(
    '#type' => 'head_tag',
    '#tag' => 'meta',
    '#attributes' => array(
      'charset' => 'utf-8',
    ),
    // Security: This always has to be output first.
    '#weight' => -1000,
  );
  // Show Backdrop and the major version number in the META GENERATOR tag.
  // Get the major version.
  list($version, ) = explode('.', BACKDROP_VERSION);
  $elements['system_meta_generator'] = array(
    '#type' => 'head_tag',
    '#tag' => 'meta',
    '#attributes' => array(
      'name' => 'Generator',
      'content' => 'Backdrop CMS ' . $version . ' (https://backdropcms.org)',
    ),
  );
  // Also send the generator in the HTTP header.
  $elements['system_meta_generator']['#attached']['backdrop_add_http_header'][] = array('X-Generator', $elements['system_meta_generator']['#attributes']['content']);
  return $elements;
}