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

@@ 750-752 (lines=3) @@
747
    }
748
749
	public static function check_label( $opt ) {
750
		if ( is_array( $opt ) ) {
751
			$opt = ( isset( $opt['label'] ) ? $opt['label'] : reset( $opt ) );
752
		}
753
754
		return $opt;
755
	}