diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 05543be..a6c6502 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -640,13 +640,13 @@ function system_theme_settings_validate($form, &$form_state) { // If the user provided a path for a logo or favicon file, make sure a file // exists at that path. - if ($form_state['values']['logo_path']) { + if (!empty($form_state['values']['logo_path'])) { $path = _system_theme_settings_validate_path($form_state['values']['logo_path']); if (!$path) { form_set_error('logo_path', t('The custom logo path is invalid.')); } } - if ($form_state['values']['favicon_path']) { + if (!empty($form_state['values']['favicon_path'])) { $path = _system_theme_settings_validate_path($form_state['values']['favicon_path']); if (!$path) { form_set_error('favicon_path', t('The custom favicon path is invalid.')); @@ -703,14 +703,16 @@ function system_theme_settings_submit($form, &$form_state) { // 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']) { + if (!empty($values['logo_upload'])) { + $file = $values['logo_upload']; unset($values['logo_upload']); $filename = file_unmanaged_copy($file->uri); $values['default_logo'] = 0; $values['logo_path'] = $filename; $values['toggle_logo'] = 1; } - if ($file = $values['favicon_upload']) { + if (!empty($values['favicon_upload'])) { + $file = $values['favicon_upload']; unset($values['favicon_upload']); $filename = file_unmanaged_copy($file->uri); $values['default_favicon'] = 0;