Skip to:
Content

BuddyPress.org

Changeset 5268


Ignore:
Timestamp:
11/03/2011 07:50:07 PM (13 years ago)
Author:
boonebgorges
Message:

Don't allow date-formatted xprofile fields to be saved if they're only partially filled in. Fixes #3630

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-signup.php

    r5266 r5268  
    7878                foreach ( (array) $profile_field_ids as $field_id ) {
    7979                    if ( !isset( $_POST['field_' . $field_id] ) ) {
    80                         if ( isset( $_POST['field_' . $field_id . '_day'] ) )
     80                        if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) )
    8181                            $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) );
    8282                    }
  • trunk/bp-xprofile/bp-xprofile-screens.php

    r5131 r5268  
    6666            if ( !isset( $_POST['field_' . $field_id] ) ) {
    6767
    68                 if ( !empty( $_POST['field_' . $field_id . '_day'] ) && is_numeric( $_POST['field_' . $field_id . '_day'] ) ) {
     68                if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) {
    6969                    // Concatenate the values
    7070                    $date_value =   $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year'];
Note: See TracChangeset for help on using the changeset viewer.