summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2012-09-15 16:33:23 -0400
committerDavid Rothstein <drothstein@gmail.com>2012-09-15 16:33:23 -0400
commita6cc373efafadca346d94d1e8ccb9f31b9c5f4a0 (patch)
treeb38bb14d46dae3ebe010aaeb9a88f52eed2f12eb
parent6208738001f44282bd9a521408d5bb12ec10072b (diff)
downloadbrdo-a6cc373efafadca346d94d1e8ccb9f31b9c5f4a0.tar.gz
brdo-a6cc373efafadca346d94d1e8ccb9f31b9c5f4a0.tar.bz2
Issue #1397882 by sun, kbasarab, catch, pingers: Fixed system_theme_settings_submit() does not properly clean up submitted form values.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--modules/system/system.admin.inc11
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 3cc01b702..6f1ca3a3c 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.16, xxxx-xx-xx (development version)
-----------------------
+- Fixed the theme settings form to properly clean up submitted values in
+ $form_state['values'] when the form is submitted (data structure change).
- Updated various admin tables to use the default "empty table" text UX
pattern.
- Added proxy server support to drupal_http_request().
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 23a975b0c..c9d623ca9 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -691,8 +691,16 @@ function _system_theme_settings_validate_path($path) {
* Process system_theme_settings form submissions.
*/
function system_theme_settings_submit($form, &$form_state) {
+ // Exclude unnecessary elements before saving.
+ form_state_values_clean($form_state);
+
$values = $form_state['values'];
+ // Extract the name of the theme from the submitted form values, then remove
+ // it from the array so that it is not saved as part of the variable.
+ $key = $values['var'];
+ unset($values['var']);
+
// If the user uploaded a new logo or favicon, save it to a permanent location
// and use it in place of the default theme-provided file.
if ($file = $values['logo_upload']) {
@@ -722,10 +730,7 @@ function system_theme_settings_submit($form, &$form_state) {
if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
$values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']);
}
- $key = $values['var'];
- // Exclude unnecessary elements before saving.
- unset($values['var'], $values['submit'], $values['reset'], $values['form_id'], $values['op'], $values['form_build_id'], $values['form_token']);
variable_set($key, $values);
drupal_set_message(t('The configuration options have been saved.'));