Skip to:
Content

BuddyPress.org

Changeset 9659


Ignore:
Timestamp:
03/29/2015 04:33:08 AM (5 years ago)
Author:
johnjamesjacoby
Message:

XProfile: Fix spelling error and avoid debug notices in BP_XProfile_Field:;admin_validate().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r9658 r9659  
    604604
    605605        // Validate Form
    606         if ( '' == $_POST['title'] || '' == $_POST['required'] || '' == $_POST['fieldtype'] ) {
     606        if ( empty( $_POST['title'] ) || ! isset( $_POST['required'] ) || empty( $_POST['fieldtype'] ) ) {
    607607            $message = __( 'Please make sure you fill out all required fields.', 'buddypress' );
    608608            return false;
     
    612612            $option_name = "{$_POST['fieldtype']}_option";
    613613
    614             if ( $field_type->supports_options && isset( $_POST[$option_name] ) && empty( $_POST[$option_name][1] ) ) {
    615                 $message = __( 'This field type require at least one option. Please add options below.', 'buddypress' );
     614            if ( ! empty( $field_type->supports_options ) && isset( $_POST[$option_name] ) && empty( $_POST[$option_name][1] ) ) {
     615                $message = __( 'This field type requires at least one option. Please add options below.', 'buddypress' );
    616616                return false;
    617617            }
Note: See TracChangeset for help on using the changeset viewer.