1 redirect.api.php hook_redirect_validate($redirect, $form, $form_state)

Perform redirect validation before a redirect is created or updated.

This hook is invoked from redirect_validate(), after a user has has finished editing the redirect and is submitting it. It is invoked at the end of all the standard validation steps.

To indicate a validation error, use form_set_error().

Note: Changes made to the $redirect object within your hook implementation will have no effect. The preferred method to change a redirect's content is to use hook_redirect_presave() instead. If it is really necessary to change the redirect at the validate stage, you can use form_set_value().

Parameters

$redirect: The redirect being validated.

$form: The form being used to edit the redirect.

$form_state: The form state array.

See also

redirect_validate()

Related topics

File

core/modules/redirect/redirect.api.php, line 196
Hooks provided by the Redirect module.

Code

function hook_redirect_validate($redirect, $form, $form_state) {

}