Code Duplication    Length = 3-3 lines in 3 locations

classes/models/FrmEntryValidate.php 3 locations

@@ 116-118 (lines=3) @@
113
        }
114
115
        // validate the url format
116
		if ( ! preg_match('/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value) ) {
117
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
118
		}
119
    }
120
121
	public static function validate_email_field( &$errors, $field, $value, $args ) {
@@ 127-129 (lines=3) @@
124
        }
125
126
        //validate the email format
127
        if ( ! is_email($value) ) {
128
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
129
        }
130
    }
131
132
	public static function validate_number_field( &$errors, $field, $value, $args ) {
@@ 162-164 (lines=3) @@
159
160
			$pattern = self::phone_format( $field );
161
162
			if ( ! preg_match( $pattern, $value ) ) {
163
				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
164
			}
165
		}
166
	}
167