Code Duplication    Length = 3-3 lines in 2 locations

classes/models/FrmEntryValidate.php 1 location

@@ 71-73 (lines=3) @@
68
		self::maybe_clear_value_for_default_blank_setting( $posted_field, $value );
69
70
		// Reset arrays with only one value if it's not a field where array keys need to be preserved
71
		if ( is_array($value) && count( $value ) == 1 && isset( $value[0] ) ) {
72
			$value = reset($value);
73
		}
74
75
        if ( $posted_field->required == '1' && ! is_array( $value ) && trim( $value ) == '' ) {
76
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );

classes/controllers/FrmFieldsController.php 1 location

@@ 607-609 (lines=3) @@
604
    }
605
606
	public static function check_label( $opt ) {
607
        if ( is_array($opt) ) {
608
            $opt = (isset($opt['label']) ? $opt['label'] : reset($opt));
609
        }
610
611
        return $opt;
612
    }