diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-06-28 12:37:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-06-28 12:37:52 +0000 |
commit | 3cdf54fb3e3f37919438d35295c06cb6211c4e83 (patch) | |
tree | 7715a9ca6880b4fd48f94956f3652a77eae1b634 /modules/system/system.module | |
parent | ba625835153e059db824923c4ed6c7858e41a930 (diff) | |
download | brdo-3cdf54fb3e3f37919438d35295c06cb6211c4e83.tar.gz brdo-3cdf54fb3e3f37919438d35295c06cb6211c4e83.tar.bz2 |
- Patch #275092 by kbahey, greggles and Arancaytar: emit X-Generator and meta-generator tags.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 4fa9992e5..a8aa32e05 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -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)'); +} |