Code Duplication    Length = 3-3 lines in 2 locations

classes/models/fields/FrmFieldUrl.php 1 location

@@ 61-63 (lines=3) @@
58
		FrmEntriesHelper::set_posted_value( $this->field, $value, $args );
59
60
		// validate the url format
61
		if ( ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) {
62
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
63
		}
64
	}
65
66
	protected function prepare_display_value( $value, $atts ) {

classes/models/FrmEntryValidate.php 1 location

@@ 175-177 (lines=3) @@
172
173
			$pattern = self::phone_format( $field );
174
175
			if ( ! preg_match( $pattern, $value ) ) {
176
				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
177
			}
178
		}
179
	}
180