Commit 2c45ab85 authored by Dries's avatar Dries
Browse files

- Fixed bug #9948: added some checks to system_setting_save() to avoid PHP warnings/errors.
parent 7ebd772f
......@@ -530,21 +530,24 @@ function system_settings_save() {
$edit = $_POST['edit'];
if ($op == t('Reset to defaults')) {
foreach ($edit as $name => $value) {
variable_del($name);
if (is_array($edit)) {
foreach ($edit as $name => $value) {
variable_del($name);
}
}
drupal_set_message(t('The configuration options have been reset to their default values.'));
}
if ($op == t('Save configuration')) {
foreach ($edit as $name => $value) {
variable_set($name, $value);
if (is_array($edit)) {
foreach ($edit as $name => $value) {
variable_set($name, $value);
}
}
drupal_set_message(t('The configuration options have been saved.'));
}
else {
return;
}
cache_clear_all();
menu_rebuild();
drupal_goto($_GET['q']);
......
......@@ -530,21 +530,24 @@ function system_settings_save() {
$edit = $_POST['edit'];
if ($op == t('Reset to defaults')) {
foreach ($edit as $name => $value) {
variable_del($name);
if (is_array($edit)) {
foreach ($edit as $name => $value) {
variable_del($name);
}
}
drupal_set_message(t('The configuration options have been reset to their default values.'));
}
if ($op == t('Save configuration')) {
foreach ($edit as $name => $value) {
variable_set($name, $value);
if (is_array($edit)) {
foreach ($edit as $name => $value) {
variable_set($name, $value);
}
}
drupal_set_message(t('The configuration options have been saved.'));
}
else {
return;
}
cache_clear_all();
menu_rebuild();
drupal_goto($_GET['q']);
......
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