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 ) {
@@ 188-190 (lines=3) @@
185
186
			$pattern = self::phone_format( $field );
187
188
			if ( ! preg_match( $pattern, $value ) ) {
189
				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
190
			}
191
		}
192
	}
193