You appear to be a bot. Output may be restricted
Description
Validate the media file contentsPerform a simple check that the md5 value passed matches the md5 calculation against the data passed. If so, decode the contens and return it.
Usage
$string = oik_clone_validate_media_fields( $data, $md5 );
Parameters
- $data
- ( string ) required – base64 encoded file contents
- $md5
- ( string ) required – MD5 calculation for the base64 encoded contents
Returns
string decoded contentsSource
File name: oik-clone/admin/oik-clone-media.phpLines:
1 to 12 of 12
function oik_clone_validate_media_fields( $data, $md5 ) { $contents = base64_decode( $data ); $testmd5 = md5( $contents ); if ( $md5 == $testmd5 ) { p( "MD5 OK" ); } else { p( "MD5 mismatch: $testmd5 <> $md5" ); // $contents = null; } //bw_trace2( $contents, "contents" ); return( $contents ); }View on GitHub