From eb412f7c7e15a8bd4e572d28e12ecaab59a7c0f7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 19 Dec 2005 14:30:53 +0000 Subject: - Patch #39179 by chx: improved validation of forms. --- modules/filter.module | 13 ------------- modules/filter/filter.module | 13 ------------- 2 files changed, 26 deletions(-) (limited to 'modules') diff --git a/modules/filter.module b/modules/filter.module index 88cb98801..b81039879 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -775,7 +775,6 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = arr '#return_value' => $format->format, '#parents' => $parents, '#description' => theme('filter_tips', _filter_tips($format->format, false)), - '#validate' => array('filter_form_validate' => array()) ); } } @@ -793,18 +792,6 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = arr return $form; } -function filter_form_validate($element) { - static $validated; - if ($validated) { - return; - } - $validated = 1; - $formats = filter_formats(); - if (!isset($formats[$element['#value']])) { - form_set_error($element['#parents'][0], t('The supplied input format is invalid.')); - } -} - /** * Returns true if the user is allowed to access this format. */ diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 88cb98801..b81039879 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -775,7 +775,6 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = arr '#return_value' => $format->format, '#parents' => $parents, '#description' => theme('filter_tips', _filter_tips($format->format, false)), - '#validate' => array('filter_form_validate' => array()) ); } } @@ -793,18 +792,6 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = 0, $parents = arr return $form; } -function filter_form_validate($element) { - static $validated; - if ($validated) { - return; - } - $validated = 1; - $formats = filter_formats(); - if (!isset($formats[$element['#value']])) { - form_set_error($element['#parents'][0], t('The supplied input format is invalid.')); - } -} - /** * Returns true if the user is allowed to access this format. */ -- cgit v1.2.3