diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2016-12-15 18:25:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-15 18:25:42 +0900 |
| commit | cae526e65a20f3da2d8884c4d8e8978c54120000 (patch) | |
| tree | 2954153dd49f616f5018490058ff4bfbd17300d3 /inc/api.php | |
| parent | b58fab98147a92c8e6d22f15d23684508b6bb811 (diff) | |
| parent | 5feae402cb55d49963bfd2c6f5a33d10690ecbc1 (diff) | |
Merge pull request #79 from lainchan/clean_prod_vichan_update
Merge vichan changes from upstream and changes directly applied to the site.
Diffstat (limited to 'inc/api.php')
| -rw-r--r-- | inc/api.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/api.php b/inc/api.php index 57e4d367..b280c25b 100644 --- a/inc/api.php +++ b/inc/api.php @@ -32,6 +32,7 @@ class Api { 'images' => 'images', 'sticky' => 'sticky', 'locked' => 'locked', + 'cycle' => 'cyclical', 'bump' => 'last_modified', 'embed' => 'embed', ); @@ -92,7 +93,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) && $file->hash) { + $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) { |
