summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-02-02 01:35:32 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-02-02 01:35:32 +0000
commit635cf5eb6df3ba4028e55b2df91f5e1ba3832758 (patch)
treeae651b06a69b5f30febb969dbc4e418c4c804e24 /includes/form.inc
parentd96be836c15c5dc20b380fe34fd4fdd334f55b11 (diff)
downloadbrdo-635cf5eb6df3ba4028e55b2df91f5e1ba3832758.tar.gz
brdo-635cf5eb6df3ba4028e55b2df91f5e1ba3832758.tar.bz2
- #39179: Allow skipping of option validation for selects
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 710a6f921..742d23a1f 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -153,8 +153,8 @@ function _form_validate($elements, $form_id = NULL) {
form_error($elements, t('%name field is required.', array('%name' => $elements['#title'])));
}
- // Add legal choice check if element has #options.
- if (isset($elements['#options']) && isset($elements['#value'])) {
+ // Add legal choice check if element has #options. Can be skipped, but then you must validate your own element.
+ if (isset($elements['#options']) && isset($elements['#value']) && !isset($elements['#DANGEROUS_SKIP_CHECK'])) {
$message = t('Illegal choice in %title.', array('%title' => theme('placeholder', $elements['#title'])));
if ($elements['#type'] == 'select') {
$options = form_options_flatten($elements['#options']);