@@ -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 = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
198 | + $field_value = isset( $entry->metas[$field->id] ) ? $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 = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
226 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $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 | } |
@@ -357,17 +357,17 @@ discard block |
||
357 | 357 | * @since 4.01 |
358 | 358 | */ |
359 | 359 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
360 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
361 | - 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 |
|
362 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
360 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
361 | + 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 |
|
362 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
363 | 363 | } |
364 | 364 | } else { |
365 | 365 | // All of the section was probably removed. |
366 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
367 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
366 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
367 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
368 | 368 | } |
369 | 369 | |
370 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
370 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | private static function get_posted_meta( $field_id, $args ) { |
398 | 398 | if ( empty( $args['parent_field_id'] ) ) { |
399 | 399 | // Sanitizing is done next. |
400 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
400 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
401 | 401 | } else { |
402 | - $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 |
|
402 | + $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 |
|
403 | 403 | } |
404 | 404 | return $value; |
405 | 405 | } |
@@ -430,14 +430,14 @@ discard block |
||
430 | 430 | self::set_other_repeating_vals( $field, $value, $args ); |
431 | 431 | |
432 | 432 | // Check if there are any posted "Other" values. |
433 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
433 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
434 | 434 | |
435 | 435 | // Save original value. |
436 | 436 | $args['temp_value'] = $value; |
437 | 437 | $args['other'] = true; |
438 | 438 | |
439 | 439 | // Sanitizing is done next. |
440 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
440 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
441 | 441 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
442 | 442 | |
443 | 443 | // Set the validation value now |
@@ -460,12 +460,12 @@ discard block |
||
460 | 460 | } |
461 | 461 | |
462 | 462 | // Check if there are any other posted "other" values for this field. |
463 | - 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 |
|
463 | + 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 |
|
464 | 464 | // Save original value |
465 | 465 | $args['temp_value'] = $value; |
466 | 466 | $args['other'] = true; |
467 | 467 | |
468 | - $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 |
|
468 | + $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 |
|
469 | 469 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
470 | 470 | |
471 | 471 | // Set the validation value now. |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
493 | 493 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
494 | 494 | foreach ( $other_vals as $k => $v ) { |
495 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
495 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
496 | 496 | // If the other box is checked, but doesn't have a value. |
497 | 497 | $value = ''; |
498 | 498 | break; |
@@ -509,25 +509,25 @@ discard block |
||
509 | 509 | |
510 | 510 | // Multi-select dropdown. |
511 | 511 | if ( is_array( $value ) ) { |
512 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
512 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
513 | 513 | |
514 | 514 | if ( $o_key !== false ) { |
515 | 515 | // Modify the original value so other key will be preserved. |
516 | - $value[ $other_key ] = $value[ $o_key ]; |
|
516 | + $value[$other_key] = $value[$o_key]; |
|
517 | 517 | |
518 | 518 | // By default, the array keys will be numeric for multi-select dropdowns. |
519 | 519 | // If going backwards and forwards between pages, the array key will match the other key. |
520 | 520 | if ( $o_key !== $other_key ) { |
521 | - unset( $value[ $o_key ] ); |
|
521 | + unset( $value[$o_key] ); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | $args['temp_value'] = $value; |
525 | - $value[ $other_key ] = reset( $other_vals ); |
|
526 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
527 | - unset( $value[ $other_key ] ); |
|
525 | + $value[$other_key] = reset( $other_vals ); |
|
526 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
527 | + unset( $value[$other_key] ); |
|
528 | 528 | } |
529 | 529 | } |
530 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
530 | + } elseif ( $field->options[$other_key] == $value ) { |
|
531 | 531 | $value = $other_vals; |
532 | 532 | }//end if |
533 | 533 | }//end if |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | * @return void |
774 | 774 | */ |
775 | 775 | public static function maybe_render_captcha_score( $entry_id ) { |
776 | - $query = array( |
|
776 | + $query = array( |
|
777 | 777 | 'item_id' => (int) $entry_id, |
778 | 778 | 'field_id' => 0, |
779 | 779 | ); |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | public static function get_entry_status_label( $status ) { |
828 | 828 | $statuses = self::get_entry_statuses(); |
829 | 829 | |
830 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
830 | + return $statuses[self::get_entry_status( $status )]; |
|
831 | 831 | } |
832 | 832 | |
833 | 833 | /** |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | } |
884 | 884 | } |
885 | 885 | |
886 | - $inbox = new FrmInbox(); |
|
886 | + $inbox = new FrmInbox(); |
|
887 | 887 | return count( $inbox->unread() ); |
888 | 888 | } |
889 | 889 | } |