Skip to content

Commit

Permalink
Fix #10184: Properly validate null values for custom date fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyreese committed May 11, 2009
1 parent 4f83762 commit 205681d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/custom_field_api.php
Expand Up @@ -1182,7 +1182,7 @@ function custom_field_validate( $p_field_id, $p_value ) {
case CUSTOM_FIELD_TYPE_DATE:
// gpc_get_cf for date returns the value from strftime
// either false (php >= 5.1) or -1 (php < 5.1) for failure
$t_valid &= ( $p_value !== false ) && ( $p_value > 0 );
$t_valid &= ( $p_value == null ) || ( ( $p_value !== false ) && ( $p_value > 0 ) );
break;
case CUSTOM_FIELD_TYPE_ENUM:
case CUSTOM_FIELD_TYPE_EMAIL:
Expand Down

0 comments on commit 205681d

Please sign in to comment.