function faq_general_settings_form_validate in Frequently Asked Questions 7
Validate for general settings form.
1 string reference to 'faq_general_settings_form_validate'
- faq_form_faq_general_settings_form_alter in ./
faq.module - Implements hook_form_FORM_ID_alter().
File
- ./
faq.admin.inc, line 75 - Administrative page callbacks for the faq module.
Code
function faq_general_settings_form_validate($form, &$form_state) {
$path = $form_state['values']['faq_path'];
// Check if there is no special characters and trailing slash.
$pattern = "/[\\w-\\/]+(?<!\\/)\$/";
if (!preg_match($pattern, $path)) {
form_set_error('faq_path', t('FAQ path is not correct.'));
}
}