Commit 3cdf54fb authored by Dries's avatar Dries

- Patch #275092 by kbahey, greggles and Arancaytar: emit X-Generator and meta-generator tags.

parent ba625835
......@@ -146,6 +146,12 @@ function system_theme() {
'system_powered_by' => array(
'arguments' => array('image_path' => NULL),
),
'meta_generator_html' => array(
'arguments' => array('version' => NULL),
),
'meta_generator_header' => array(
'arguments' => array('version' => NULL),
),
'system_compact_link' => array(),
));
}
......@@ -682,6 +688,15 @@ function system_init() {
drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module');
// Get the major version
list($version,) = explode('.', VERSION);
// Emit the META tag in the HTML HEAD section
theme('meta_generator_html', $version);
// Emit the HTTP Header too
theme('meta_generator_header', $version);
}
/**
......@@ -2071,3 +2086,22 @@ function theme_system_compact_link() {
return $output;
}
/**
* Send Drupal and the major version number in the META GENERATOR HTML.
*
* @ingroup themeable
*/
function theme_meta_generator_html($version = VERSION) {
drupal_set_html_head('<meta name="Generator" content="Drupal ' . $version . ' (http://drupal.org)" />');
}
/**
* Send Drupal and the major version number in the HTTP headers.
*
* @ingroup themeable
*/
function theme_meta_generator_header($version = VERSION) {
drupal_set_header('X-Generator: Drupal ' . $version . ' (http://drupal.org)');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment