diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-26 12:45:20 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-26 12:45:20 +0000 |
commit | 32bc8911b1d7345d78c17e36dbbbe64119d62e96 (patch) | |
tree | f11e31773a61d2fbbc5818888cad0fcfdccf5e6e /includes | |
parent | 866a2baeeb2c0bf18e4d6162a926dd35f57a2f77 (diff) | |
download | brdo-32bc8911b1d7345d78c17e36dbbbe64119d62e96.tar.gz brdo-32bc8911b1d7345d78c17e36dbbbe64119d62e96.tar.bz2 |
- Patch #629902 by andypost, JohnAlbin, David_Rothstein: critical bug: theme_get_setting() should return NULL for features that are disabled in a theme.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index f5812999f..65da03de3 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1152,18 +1152,12 @@ function theme_get_setting($setting_name, $theme = NULL) { 'favicon_path' => '', // Use the IANA-registered MIME type for ICO files as default. 'favicon_mimetype' => 'image/vnd.microsoft.icon', - 'main_menu' => 1, - 'secondary_menu' => 1, - 'toggle_logo' => 1, - 'toggle_favicon' => 1, - 'toggle_name' => 1, - 'toggle_slogan' => 1, - 'toggle_node_user_picture' => 1, - 'toggle_comment_user_picture' => 1, - 'toggle_comment_user_verification' => 1, - 'toggle_main_menu' => 1, - 'toggle_secondary_menu' => 1, ); + // Turn on all default features. + $features = _system_default_theme_features(); + foreach ($features as $feature) { + $cache[$theme]['toggle_' . $feature] = 1; + } // Get the values for the theme-specific settings from the .info files of // the theme and all its base themes. @@ -1193,6 +1187,16 @@ function theme_get_setting($setting_name, $theme = NULL) { // Get the saved theme-specific settings from the database. $cache[$theme] = array_merge($cache[$theme], variable_get('theme_' . $theme . '_settings', array())); + // If the theme does not support a particular feature, override the global + // setting and set the value to NULL. + if (!empty($theme_object->info['features'])) { + foreach ($features as $feature) { + if (!in_array($feature, $theme_object->info['features'])) { + $cache[$theme]['toggle_' . $feature] = NULL; + } + } + } + // Generate the path to the logo image. if ($cache[$theme]['toggle_logo']) { if ($cache[$theme]['default_logo']) { |