You are here

function xhprof_admin_settings_validate in XHProf 6

Same name and namespace in other branches
  1. 7 xhprof.admin.inc \xhprof_admin_settings_validate()

Validation handler for settings form.

File

./xhprof.admin.inc, line 47
Admin page callbacks for the XHProf module.

Code

function xhprof_admin_settings_validate($form, &$form_state) {

  // TODO: Simplify this.
  if (isset($form_state['values']['xhprof_interval']) && $form_state['values']['xhprof_interval'] != '' && (!is_numeric($form_state['values']['xhprof_interval']) || $form_state['values']['xhprof_interval'] <= 0 || $form_state['values']['xhprof_interval'] > mt_getrandmax())) {
    form_set_error('xhprof_interval', 'The profiling interval must be set to a positive integer.');
  }
}