Core Function
View Source on Trac ↗ verify_file_md5()
verify_file_md5( mixed $filename, mixed $expected_md5 ) Calculates and compares the MD5 of a file to its expected value.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $filename string | The filename to check the MD5 of. Required |
| string | $expected_md5 The expected MD5 of the file, either a base64-encoded raw md5, or a hex-encoded md5. Required |
Return Value
((bool)
(bool | WP_Error) True on success, false when the MD5 format is unknown/unexpected,
WP_Error on failure.
Function Information
Since Version
3.7.0
Source File
wp-admin/includes/file.php
Advertisement