@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if ( $new_val !== $value ) { |
| 219 | - $new_values[ $key ] = $new_val; |
|
| 219 | + $new_values[$key] = $new_val; |
|
| 220 | 220 | } |
| 221 | 221 | }//end foreach |
| 222 | 222 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | foreach ( $values as $value_key => $value ) { |
| 255 | 255 | if ( $value_key && in_array( $value_key, $form_fields ) ) { |
| 256 | - $new_values[ $value_key ] = $value; |
|
| 256 | + $new_values[$value_key] = $value; |
|
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
@@ -338,15 +338,15 @@ discard block |
||
| 338 | 338 | $existing_keys = array_keys( $values['item_meta'] ); |
| 339 | 339 | foreach ( $all_fields as $fid ) { |
| 340 | 340 | if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { |
| 341 | - $values['item_meta'][ $fid->id ] = ''; |
|
| 341 | + $values['item_meta'][$fid->id] = ''; |
|
| 342 | 342 | } |
| 343 | - $field_array[ $fid->id ] = $fid; |
|
| 343 | + $field_array[$fid->id] = $fid; |
|
| 344 | 344 | } |
| 345 | 345 | unset( $all_fields ); |
| 346 | 346 | |
| 347 | 347 | foreach ( $values['item_meta'] as $field_id => $default_value ) { |
| 348 | - if ( isset( $field_array[ $field_id ] ) ) { |
|
| 349 | - $field = $field_array[ $field_id ]; |
|
| 348 | + if ( isset( $field_array[$field_id] ) ) { |
|
| 349 | + $field = $field_array[$field_id]; |
|
| 350 | 350 | } else { |
| 351 | 351 | $field = FrmField::getOne( $field_id ); |
| 352 | 352 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | continue; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ); |
|
| 358 | + $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) ); |
|
| 359 | 359 | if ( $is_settings_page ) { |
| 360 | 360 | self::get_settings_page_html( $values, $field ); |
| 361 | 361 | |
@@ -375,22 +375,22 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | foreach ( $update_options as $opt => $default ) { |
| 378 | - $field->field_options[ $opt ] = $values['field_options'][ $opt . '_' . $field_id ] ?? $default; |
|
| 379 | - self::sanitize_field_opt( $opt, $field->field_options[ $opt ] ); |
|
| 378 | + $field->field_options[$opt] = $values['field_options'][$opt . '_' . $field_id] ?? $default; |
|
| 379 | + self::sanitize_field_opt( $opt, $field->field_options[$opt] ); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | $field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values ); |
| 383 | 383 | |
| 384 | 384 | $new_field = array( |
| 385 | 385 | 'field_options' => $field->field_options, |
| 386 | - 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
|
| 386 | + 'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '', |
|
| 387 | 387 | ); |
| 388 | 388 | |
| 389 | - if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) { |
|
| 390 | - foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) { |
|
| 389 | + if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) { |
|
| 390 | + foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) { |
|
| 391 | 391 | if ( is_array( $option ) ) { |
| 392 | 392 | foreach ( $option as $key => $item ) { |
| 393 | - $values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' ); |
|
| 393 | + $values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' ); |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | } |
@@ -420,8 +420,8 @@ discard block |
||
| 420 | 420 | */ |
| 421 | 421 | private static function maybe_update_max_option( $field, $values, &$new_field ) { |
| 422 | 422 | if ( $field->type === 'textarea' && |
| 423 | - ! empty( $values['field_options'][ 'type_' . $field->id ] ) && |
|
| 424 | - in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) { |
|
| 423 | + ! empty( $values['field_options']['type_' . $field->id] ) && |
|
| 424 | + in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) { |
|
| 425 | 425 | |
| 426 | 426 | $new_field['field_options']['max'] = ''; |
| 427 | 427 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads. |
| 430 | 430 | * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting. |
| 431 | 431 | */ |
| 432 | - $_POST['field_options'][ 'max_' . $field->id ] = ''; |
|
| 432 | + $_POST['field_options']['max_' . $field->id] = ''; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | |
@@ -511,11 +511,11 @@ discard block |
||
| 511 | 511 | * @return void |
| 512 | 512 | */ |
| 513 | 513 | private static function get_settings_page_html( $values, &$field ) { |
| 514 | - if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) { |
|
| 514 | + if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) { |
|
| 515 | 515 | $prev_opts = array(); |
| 516 | 516 | $fallback_html = $field->field_options['custom_html'] ?? FrmFieldsHelper::get_default_html( $field->type ); |
| 517 | 517 | |
| 518 | - $field->field_options['custom_html'] = $values['field_options'][ 'custom_html_' . $field->id ] ?? $fallback_html; |
|
| 518 | + $field->field_options['custom_html'] = $values['field_options']['custom_html_' . $field->id] ?? $fallback_html; |
|
| 519 | 519 | } elseif ( $field->type === 'hidden' || $field->type === 'user_id' ) { |
| 520 | 520 | $prev_opts = $field->field_options; |
| 521 | 521 | } |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | ); |
| 541 | 541 | foreach ( $field_cols as $col => $default ) { |
| 542 | 542 | $default = $default === '' ? $field->{$col} : $default; |
| 543 | - $new_field[ $col ] = $values['field_options'][ $col . '_' . $field->id ] ?? $default; |
|
| 543 | + $new_field[$col] = $values['field_options'][$col . '_' . $field->id] ?? $default; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | if ( $field->type === 'submit' && isset( $new_field['field_order'] ) && (int) $new_field['field_order'] === FrmSubmitHelper::DEFAULT_ORDER ) { |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | if ( ! isset( $form->options['trash_time'] ) || $form->options['trash_time'] < $delete_timestamp ) { |
| 735 | 735 | self::destroy( $form->id ); |
| 736 | 736 | if ( empty( $form->parent_form_id ) ) { |
| 737 | - ++$count; |
|
| 737 | + ++ $count; |
|
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | |
@@ -961,16 +961,16 @@ discard block |
||
| 961 | 961 | foreach ( $results as $row ) { |
| 962 | 962 | if ( 'trash' != $row->status ) { |
| 963 | 963 | if ( $row->is_template ) { |
| 964 | - ++$counts['template']; |
|
| 964 | + ++ $counts['template']; |
|
| 965 | 965 | } else { |
| 966 | - ++$counts['published']; |
|
| 966 | + ++ $counts['published']; |
|
| 967 | 967 | } |
| 968 | 968 | } else { |
| 969 | - ++$counts['trash']; |
|
| 969 | + ++ $counts['trash']; |
|
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | if ( 'draft' == $row->status ) { |
| 973 | - ++$counts['draft']; |
|
| 973 | + ++ $counts['draft']; |
|
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | unset( $row ); |
@@ -1011,8 +1011,8 @@ discard block |
||
| 1011 | 1011 | self::maybe_get_form( $form ); |
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | - if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) { |
|
| 1015 | - return $frm_vars['form_params'][ $form->id ]; |
|
| 1014 | + if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) { |
|
| 1015 | + return $frm_vars['form_params'][$form->id]; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | $action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1041,15 +1041,15 @@ discard block |
||
| 1041 | 1041 | // If there are two forms on the same page, make sure not to submit both. |
| 1042 | 1042 | foreach ( $default_values as $var => $default ) { |
| 1043 | 1043 | if ( $var === 'action' ) { |
| 1044 | - $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 1044 | + $values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 1045 | 1045 | } else { |
| 1046 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1046 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1047 | 1047 | } |
| 1048 | 1048 | unset( $var, $default ); |
| 1049 | 1049 | } |
| 1050 | 1050 | } else { |
| 1051 | 1051 | foreach ( $default_values as $var => $default ) { |
| 1052 | - $values[ $var ] = $default; |
|
| 1052 | + $values[$var] = $default; |
|
| 1053 | 1053 | unset( $var, $default ); |
| 1054 | 1054 | } |
| 1055 | 1055 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | 'sdir' => '', |
| 1076 | 1076 | ); |
| 1077 | 1077 | foreach ( $defaults as $var => $default ) { |
| 1078 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1078 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | return $values; |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | 'keep_post' => '', |
| 1104 | 1104 | ); |
| 1105 | 1105 | foreach ( $defaults as $var => $default ) { |
| 1106 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1106 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | return $values; |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | $form = $atts['form']; |
| 1218 | 1218 | $default = $atts['default'] ?? ''; |
| 1219 | 1219 | |
| 1220 | - return $form->options[ $atts['option'] ] ?? $default; |
|
| 1220 | + return $form->options[$atts['option']] ?? $default; |
|
| 1221 | 1221 | } |
| 1222 | 1222 | |
| 1223 | 1223 | /** |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 138 | 138 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 139 | 139 | if ( $repeating ) { |
| 140 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 140 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 141 | 141 | $value_is_posted = true; |
| 142 | 142 | } |
| 143 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 143 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 144 | 144 | $value_is_posted = true; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 173 | 173 | |
| 174 | 174 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 175 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 175 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 176 | 176 | if ( ! empty( $add_atts ) ) { |
| 177 | 177 | $this_atts = array_merge( $atts, $add_atts ); |
| 178 | 178 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 183 | 183 | |
| 184 | 184 | // Add the default message. |
| 185 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 185 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $message; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | 197 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 198 | - $field_value = $entry->metas[ $field->id ] ?? false; |
|
| 198 | + $field_value = $entry->metas[$field->id] ?? false; |
|
| 199 | 199 | |
| 200 | 200 | if ( FrmAppHelper::pro_is_installed() ) { |
| 201 | 201 | $empty = empty( $field_value ); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 224 | 224 | } else { |
| 225 | 225 | // Get all values for this field. |
| 226 | - $child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false; |
|
| 226 | + $child_values = $entry->metas[$atts['embedded_field_id']] ?? false; |
|
| 227 | 227 | |
| 228 | 228 | if ( $child_values ) { |
| 229 | 229 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $value = $args['temp_value']; |
| 346 | 346 | } |
| 347 | 347 | if ( empty( $args['parent_field_id'] ) ) { |
| 348 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 348 | + $_POST['item_meta'][$field->id] = $value; |
|
| 349 | 349 | } else { |
| 350 | 350 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 351 | 351 | } |
@@ -363,17 +363,17 @@ discard block |
||
| 363 | 363 | * @return void |
| 364 | 364 | */ |
| 365 | 365 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 366 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 367 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 368 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 366 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 367 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 368 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 369 | 369 | } |
| 370 | 370 | } else { |
| 371 | 371 | // All of the section was probably removed. |
| 372 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 373 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 372 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 373 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 376 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | private static function get_posted_meta( $field_id, $args ) { |
| 414 | 414 | if ( empty( $args['parent_field_id'] ) ) { |
| 415 | 415 | // Sanitizing is done next. |
| 416 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 416 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 417 | 417 | } else { |
| 418 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 418 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 419 | 419 | } |
| 420 | 420 | return $value; |
| 421 | 421 | } |
@@ -446,14 +446,14 @@ discard block |
||
| 446 | 446 | self::set_other_repeating_vals( $field, $value, $args ); |
| 447 | 447 | |
| 448 | 448 | // Check if there are any posted "Other" values. |
| 449 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 449 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 450 | 450 | |
| 451 | 451 | // Save original value. |
| 452 | 452 | $args['temp_value'] = $value; |
| 453 | 453 | $args['other'] = true; |
| 454 | 454 | |
| 455 | 455 | // Sanitizing is done next. |
| 456 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 456 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 457 | 457 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 458 | 458 | |
| 459 | 459 | // Set the validation value now |
@@ -476,12 +476,12 @@ discard block |
||
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | // Check if there are any other posted "other" values for this field. |
| 479 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 479 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 480 | 480 | // Save original value |
| 481 | 481 | $args['temp_value'] = $value; |
| 482 | 482 | $args['other'] = true; |
| 483 | 483 | |
| 484 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 484 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 485 | 485 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 486 | 486 | |
| 487 | 487 | // Set the validation value now. |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 509 | 509 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 510 | 510 | foreach ( $other_vals as $k => $v ) { |
| 511 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 511 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 512 | 512 | // If the other box is checked, but doesn't have a value. |
| 513 | 513 | $value = ''; |
| 514 | 514 | break; |
@@ -525,25 +525,25 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | // Multi-select dropdown. |
| 527 | 527 | if ( is_array( $value ) ) { |
| 528 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 528 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 529 | 529 | |
| 530 | 530 | if ( $o_key !== false ) { |
| 531 | 531 | // Modify the original value so other key will be preserved. |
| 532 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 532 | + $value[$other_key] = $value[$o_key]; |
|
| 533 | 533 | |
| 534 | 534 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 535 | 535 | // If going backwards and forwards between pages, the array key will match the other key. |
| 536 | 536 | if ( $o_key !== $other_key ) { |
| 537 | - unset( $value[ $o_key ] ); |
|
| 537 | + unset( $value[$o_key] ); |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | $args['temp_value'] = $value; |
| 541 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 542 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 543 | - unset( $value[ $other_key ] ); |
|
| 541 | + $value[$other_key] = reset( $other_vals ); |
|
| 542 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 543 | + unset( $value[$other_key] ); |
|
| 544 | 544 | } |
| 545 | 545 | } |
| 546 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 546 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 547 | 547 | $value = $other_vals; |
| 548 | 548 | }//end if |
| 549 | 549 | }//end if |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | * @return void |
| 798 | 798 | */ |
| 799 | 799 | public static function maybe_render_captcha_score( $entry_id ) { |
| 800 | - $query = array( |
|
| 800 | + $query = array( |
|
| 801 | 801 | 'item_id' => (int) $entry_id, |
| 802 | 802 | 'field_id' => 0, |
| 803 | 803 | ); |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | public static function get_entry_status_label( $status ) { |
| 852 | 852 | $statuses = self::get_entry_statuses(); |
| 853 | 853 | |
| 854 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 854 | + return $statuses[self::get_entry_status( $status )]; |
|
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | /** |