Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/04/2010 12:10:32 PM (14 years ago)
Author:
apeatling
Message:

Fixes #1802

File:
1 edited

Legend:

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

    r2576 r2583  
    5353        $bp->signup->email = $_POST['signup_email'];
    5454
    55         /* Now we've checked account details, we can check profile information */
    56         $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
    57 
    58         /* Loop through the posted fields formatting any datebox values then validate the field */
    59         foreach ( (array) $profile_field_ids as $field_id ) {
    60             if ( !isset( $_POST['field_' . $field_id] ) ) {
    61                 if ( isset( $_POST['field_' . $field_id . '_day'] ) )
    62                     $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] );
    63             }
    64 
    65             if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )
    66                 $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
     55        if ( !empty( $_POST['signup_profile_field_ids'] ) && function_exists( 'xprofile_check_is_required_field' ) ) {
     56            /* Now we've checked account details, we can check profile information */
     57            $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
     58
     59            /* Loop through the posted fields formatting any datebox values then validate the field */
     60            foreach ( (array) $profile_field_ids as $field_id ) {
     61                if ( !isset( $_POST['field_' . $field_id] ) ) {
     62                    if ( isset( $_POST['field_' . $field_id . '_day'] ) )
     63                        $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] );
     64                }
     65
     66                if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )
     67                    $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
     68            }
    6769        }
    6870
Note: See TracChangeset for help on using the changeset viewer.