summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/api.php7
-rw-r--r--inc/config.php4
2 files changed, 8 insertions, 3 deletions
diff --git a/inc/api.php b/inc/api.php
index 57e4d367..9483200e 100644
--- a/inc/api.php
+++ b/inc/api.php
@@ -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) {
diff --git a/inc/config.php b/inc/config.php
index c0e967af..b92c4ac0 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -807,8 +807,8 @@
// Set this to true if you're using a BSD
$config['bsd_md5'] = false;
- // Set this to true if you're having problems with image duplicated error and bsd_md5 doesn't help.
- $config['php_md5'] = false;
+ // Set this to true if you're using Linux and you can execute `md5sum` binary.
+ $config['gnu_md5'] = false;
// Number of posts in a "View Last X Posts" page
$config['noko50_count'] = 50;