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

@@ 739-741 (lines=3) @@
736
    }
737
738
	public static function check_label( $opt ) {
739
		if ( is_array( $opt ) ) {
740
			$opt = ( isset( $opt['label'] ) ? $opt['label'] : reset( $opt ) );
741
		}
742
743
		return $opt;
744
	}