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

@@ 714-716 (lines=3) @@
711
    }
712
713
	public static function check_label( $opt ) {
714
        if ( is_array($opt) ) {
715
            $opt = (isset($opt['label']) ? $opt['label'] : reset($opt));
716
        }
717
718
        return $opt;
719
    }