From 6d802855138f1ca4ef647a7b3d88ea2e7df6ce9b Mon Sep 17 00:00:00 2001 From: PupperWoff Date: Thu, 3 May 2018 23:17:57 +0200 Subject: [PATCH] Add image spoiler flag to JSON API --- inc/api.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/api.php b/inc/api.php index b280c25b..d306be5d 100644 --- a/inc/api.php +++ b/inc/api.php @@ -93,6 +93,12 @@ class Api { $dotPos = strrpos($file->file, '.'); $apiPost['ext'] = substr($file->file, $dotPos); $apiPost['tim'] = substr($file->file, 0, $dotPos); + + // Add spoiler flag to API data + $apiPost['spoiler'] = 0; + if(isset($file->thumb) && $file->thumb == 'spoiler') + $apiPost['spoiler'] = 1; + if (isset ($file->hash) && $file->hash) { $apiPost['md5'] = base64_encode(hex2bin($file->hash)); }