Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/06/2023 11:35:55 PM (3 years ago)
Author:
espellcaste
Message:

PHPCS: adding a little bit of space between brackets.

Closes https://github.com/buddypress/buddypress/pull/44
See #7228

File:
1 edited

Legend:

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

    r13372 r13392  
    125125            // Check for updated posted values, but errors preventing them from
    126126            // being saved first time.
    127             if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_value != $_POST['field_' . $this->field_obj->id] ) {
    128                 if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
    129                     $option_value = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
     127            if ( isset( $_POST[ 'field_' . $this->field_obj->id ] ) && $option_value != $_POST[ 'field_' . $this->field_obj->id ] ) {
     128                if ( ! empty( $_POST[ 'field_' . $this->field_obj->id ] ) ) {
     129                    $option_value = sanitize_text_field( $_POST[ 'field_' . $this->field_obj->id ] );
    130130                }
    131131            }
     
    133133            // Run the allowed option name through the before_save filter, so
    134134            // we'll be sure to get a match.
    135             $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
     135            $allowed_options = xprofile_sanitize_data_value_before_save( $options[ $k ]->name, false, false );
    136136            $selected        = '';
    137137
    138             if ( $option_value === $allowed_options || ( empty( $option_value ) && ! empty( $options[$k]->is_default_option ) ) ) {
     138            if ( $option_value === $allowed_options || ( empty( $option_value ) && ! empty( $options[ $k ]->is_default_option ) ) ) {
    139139                $selected = ' checked="checked"';
    140140            }
     
    144144                esc_attr( bp_get_the_profile_field_input_name() ),
    145145                esc_attr( "option_{$options[$k]->id}" ),
    146                 esc_attr( stripslashes( $options[$k]->name ) ),
    147                 esc_html( stripslashes( $options[$k]->name ) )
     146                esc_attr( stripslashes( $options[ $k ]->name ) ),
     147                esc_html( stripslashes( $options[ $k ]->name ) )
    148148            );
    149149
     
    159159             * @param string $k        Current index in the foreach loop.
    160160             */
    161             $html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
     161            $html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[ $k ], $this->field_obj->id, $selected, $k );
    162162        }
    163163
Note: See TracChangeset for help on using the changeset viewer.