Commit cd8d79b1 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#200777 by JirkaRybka: theme settings form relied on _POST[] and stored...

#200777 by JirkaRybka: theme settings form relied on _POST[] and stored irrelevant formapi keys as theme settings
parent 408d4caf
...@@ -537,18 +537,17 @@ function system_theme_settings(&$form_state, $key = '') { ...@@ -537,18 +537,17 @@ function system_theme_settings(&$form_state, $key = '') {
* Process system_theme_settings form submissions. * Process system_theme_settings form submissions.
*/ */
function system_theme_settings_submit($form, &$form_state) { function system_theme_settings_submit($form, &$form_state) {
$op = isset($_POST['op']) ? $_POST['op'] : ''; $values = $form_state['values'];
$key = $form_state['values']['var']; $key = $values['var'];
// Exclude unnecessary elements. if ($values['op'] == t('Reset to defaults')) {
unset($form_state['values']['var'], $form_state['values']['submit'], $form_state['values']['reset'], $form_state['values']['form_id']);
if ($op == t('Reset to defaults')) {
variable_del($key); variable_del($key);
drupal_set_message(t('The configuration options have been reset to their default values.')); drupal_set_message(t('The configuration options have been reset to their default values.'));
} }
else { else {
variable_set($key, $form_state['values']); // 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.')); drupal_set_message(t('The configuration options have been saved.'));
} }
......
Supports Markdown
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