Skip to:
Content

BuddyPress.org

Ticket #6552: 6552.patch

File 6552.patch, 1.3 KB (added by Offereins, 5 years ago)
  • src/bp-xprofile/classes/class-bp-xprofile-field.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field.php src/bp-xprofile/classes/class-bp-xprofile-field.php
    index 8913109..01ac644 100644
    class BP_XProfile_Field { 
    282282                }
    283283
    284284                /**
    285                  * Check for null so field options can be changed without changing any
     285                 * Check for false so field options can be changed without changing any
    286286                 * other part of the field. The described situation will return 0 here.
    287287                 */
    288                 if ( $wpdb->query( $sql ) !== null ) {
     288                if ( $wpdb->query( $sql ) !== false ) {
    289289
    290290                        if ( !empty( $this->id ) ) {
    291291                                $field_id = $this->id;
  • bp-xprofile/classes/class-bp-xprofile-group.php

    diff --git a/bp-xprofile/classes/class-bp-xprofile-group.php b/bp-xprofile/classes/class-bp-xprofile-group.php
    index d2215fb..4899937 100644
    a b class BP_XProfile_Group { 
    140140                // Attempt to insert or update
    141141                $query = $wpdb->query( $sql );
    142142
    143                 // Bail if query fails
    144                 if ( empty( $query ) || is_wp_error( $query ) ) {
     143                /**
     144                 * Check for false so field options can be changed without changing any
     145                 * other part of the field. The described situation will return 0 here.
     146                 */
     147                if ( $query === false ) {
    145148                        return false;
    146149                }
    147150