Merge branch 'php8' into section

This commit is contained in:
xiaomlove
2022-11-05 02:48:48 +08:00
6 changed files with 36 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.30');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-10-29');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-11-05');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+6 -1
View File
@@ -5742,7 +5742,12 @@ function can_access_torrent($torrent)
if (is_array($torrent) && isset($torrent['search_box_id'])) {
$searchBoxId = $torrent['search_box_id'];
} elseif (is_numeric($torrent)) {
$searchBoxId = \App\Models\Torrent::query()->findOrFail(intval($torrent), ['id', 'category'])->basic_category->mode;
$torrent = \App\Models\Torrent::query()->findOrFail(intval($torrent), ['id', 'category']);
$searchBoxId = $torrent->basic_category->mode ?? 0;
if ($searchBoxId == 0) {
do_log("[INVALID_CATEGORY], torrent: " . $torrent->id, 'error');
return false;
}
} else {
throw new \InvalidArgumentException("Unsupported argument: " . json_encode($torrent));
}