You are here

function url_alter_validate_php_element in URL alter 6

1 string reference to 'url_alter_validate_php_element'
url_alter_settings_form in ./url_alter.admin.inc
@file Administrative page callbacks for the url_alter module.

File

./url_alter.admin.inc, line 29
Administrative page callbacks for the url_alter module.

Code

function url_alter_validate_php_element($element, &$form_state) {
  $code =& $form_state['values'][$element['#name']];
  $code = trim($code);
  $result = url_alter_check_php_syntax($element['#url_alter_variables'] . $code);
  if ($result !== TRUE) {
    form_error($element, t('@function did not validate.', array(
      '@function' => $element['#title'],
    )));
  }
}