Code Duplication    Length = 3-3 lines in 2 locations

classes/models/FrmEntryValidate.php 1 location

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

classes/controllers/FrmFieldsController.php 1 location

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