system_site_information_settings_validate

Versions
6 – 7
system_site_information_settings_validate($form, &$form_state)

Validate the submitted site-information form.

Code

modules/system/system.admin.inc, line 1467

<?php
function system_site_information_settings_validate($form, &$form_state) {
  // Validate the e-mail address.
  if ($error = user_validate_mail($form_state['values']['site_mail'])) {
    form_set_error('site_mail', $error);
  }
  // Get the normal path of the front page.
  form_set_value($form['site_frontpage'], drupal_get_normal_path($form_state['values']['site_frontpage']), $form_state);
  // Validate front page path.
  $item = array('link_path' => $form_state['values']['site_frontpage']);
  if (!menu_valid_path($item)) {
    form_set_error('site_frontpage', t("The path '@path' is either invalid or you do not have access to it.", array('@path' => $item['link_path'])));
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.