Code Duplication    Length = 3-3 lines in 2 locations

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 ( ! is_array( $value ) ) {
88
			$value = trim( $value );

classes/controllers/FrmFieldsController.php 1 location

@@ 759-761 (lines=3) @@
756
	}
757
758
	public static function check_label( $opt ) {
759
		if ( is_array( $opt ) ) {
760
			$opt = ( isset( $opt['label'] ) ? $opt['label'] : reset( $opt ) );
761
		}
762
763
		return $opt;
764
	}