Code Duplication    Length = 3-3 lines in 3 locations

classes/models/FrmEntryValidate.php 3 locations

@@ 127-129 (lines=3) @@
124
        }
125
126
        // validate the url format
127
		if ( ! preg_match('/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value) ) {
128
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
129
		}
130
    }
131
132
	public static function validate_email_field( &$errors, $field, $value, $args ) {
@@ 138-140 (lines=3) @@
135
        }
136
137
        //validate the email format
138
        if ( ! is_email($value) ) {
139
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
140
        }
141
    }
142
143
	public static function validate_number_field( &$errors, $field, $value, $args ) {
@@ 173-175 (lines=3) @@
170
171
			$pattern = self::phone_format( $field );
172
173
			if ( ! preg_match( $pattern, $value ) ) {
174
				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
175
			}
176
		}
177
	}
178