Code Duplication    Length = 3-3 lines in 2 locations

classes/controllers/FrmFieldsController.php 1 location

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

classes/models/FrmEntryValidate.php 1 location

@@ 83-85 (lines=3) @@
80
		self::maybe_clear_value_for_default_blank_setting( $posted_field, $value );
81
82
		// Reset arrays with only one value if it's not a field where array keys need to be preserved
83
		if ( is_array($value) && count( $value ) == 1 && isset( $value[0] ) ) {
84
			$value = reset($value);
85
		}
86
87
        if ( $posted_field->required == '1' && ! is_array( $value ) && trim( $value ) == '' ) {
88
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );