simplify the md5 execution logic

This commit is contained in:
czaks committed 2016-05-05 08:22:19 +02:00
1 parent 9768161327
commit dcf5d699bd
3 files changed
+31 -26

No files matched your search

+6 -1
View File
@@ -92,7 +92,12 @@ class Api {
$dotPos = strrpos($file->file, '.');
$apiPost['ext'] = substr($file->file, $dotPos);
$apiPost['tim'] = substr($file->file, 0, $dotPos);
$apiPost['md5'] = base64_encode(hex2bin($post->filehash));
if (isset ($file->hash) && $post->filehash) {
$apiPost['md5'] = base64_encode(hex2bin($file->hash));
}
else if (isset ($post->filehash) && $post->filehash) {
$apiPost['md5'] = base64_encode(hex2bin($post->filehash));
}
}
private function translatePost($post, $threadsPage = false) {