From bb585ec6318b638fd3a5e54fa646ee0afd2835de Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 30 Jul 2022 15:42:07 +0800 Subject: [PATCH] fix get_globao_sp_state --- include/globalfunctions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/globalfunctions.php b/include/globalfunctions.php index c649b56d..24676e42 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -10,11 +10,13 @@ function get_global_sp_state() \Nexus\Database\NexusDB::cache_put($cacheKey . '_deadline', $row['deadline'], 600); return $row; }); - if (isset($row['deadline']) && $row['deadline'] < date('Y-m-d H:i:s')) { + if (is_array($row) && isset($row['deadline']) && $row['deadline'] < date('Y-m-d H:i:s')) { //expired $global_promotion_state = \App\Models\Torrent::PROMOTION_NORMAL; - } else { + } elseif (is_array($row)) { $global_promotion_state = $row["global_sp_state"]; + } else { + $global_promotion_state = $row; } } return $global_promotion_state;