Skip to content

Commit

Permalink
fix get_globao_sp_state
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Jul 30, 2022
1 parent b6b7a96 commit bb585ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/globalfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb585ec

Please sign in to comment.