Commit a74ffedc authored by catch's avatar catch
Browse files

Issue #1397882 by sun: Fixed system_theme_settings_submit() does not properly...

Issue #1397882 by sun: Fixed system_theme_settings_submit() does not properly clean up submitted form values.
parent 49d4a62c
......@@ -666,6 +666,11 @@ 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);
$key = $form_state['values']['var'];
unset($form_state['values']['var']);
$values = $form_state['values'];
// If the user uploaded a new logo or favicon, save it to a permanent location
......@@ -697,10 +702,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.'));
......
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