Code Duplication    Length = 3-3 lines in 3 locations

classes/models/FrmEntryValidate.php 3 locations

@@ 138-140 (lines=3) @@
135
        }
136
137
        // validate the url format
138
		if ( ! preg_match('/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value) ) {
139
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
140
		}
141
    }
142
143
	public static function validate_email_field( &$errors, $field, $value, $args ) {
@@ 149-151 (lines=3) @@
146
        }
147
148
        //validate the email format
149
        if ( ! is_email($value) ) {
150
			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
151
        }
152
    }
153
154
	public static function validate_number_field( &$errors, $field, $value, $args ) {
@@ 184-186 (lines=3) @@
181
182
			$pattern = self::phone_format( $field );
183
184
			if ( ! preg_match( $pattern, $value ) ) {
185
				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
186
			}
187
		}
188
	}
189