diff --git a/includes/form.inc b/includes/form.inc index 956f509..dca8f0c 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1368,7 +1368,7 @@ function form_type_select_value($form, $edit = FALSE) { * for this element. Return NULL to use the default. */ function form_type_textarea_value($form, $edit = FALSE) { - if ($edit !== FALSE) { + if ($edit !== FALSE && $edit !== NULL) { // This should be a string, but allow other scalars since they might be // valid input in programmatic form submissions. return is_scalar($edit) ? (string) $edit : ''; @@ -1388,7 +1388,7 @@ function form_type_textarea_value($form, $edit = FALSE) { * for this element. Return nothing to use the default. */ function form_type_textfield_value($form, $edit = FALSE) { - if ($edit !== FALSE) { + if ($edit !== FALSE && $edit !== NULL) { // This should be a string, but allow other scalars since they might be // valid input in programmatic form submissions. if (!is_scalar($edit)) { @@ -1411,8 +1411,8 @@ function form_type_textfield_value($form, $edit = FALSE) { * for this element. Return nothing to use the default. */ function form_type_token_value($form, $edit = FALSE) { - if ($edit !== FALSE) { - return (string)$edit; + if ($edit !== FALSE && $edit !== NULL) { + return (string) $edit; } }