From 6b7fb5000e222321d21143ccd4de5b4784994a08 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 5 Jun 2021 22:41:27 +0800 Subject: [PATCH] fix https_announce_url --- app/Console/Commands/Test.php | 10 +++++----- nexus/Database/DB.php | 6 ++++++ public/download.php | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 4437afa2..01bfa447 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -11,6 +11,7 @@ use App\Repositories\ExamRepository; use App\Repositories\SearchBoxRepository; use App\Repositories\TorrentRepository; use Carbon\Carbon; +use Doctrine\DBAL\Schema\Schema; use Illuminate\Console\Command; use Illuminate\Encryption\Encrypter; use Illuminate\Support\Facades\DB; @@ -50,11 +51,10 @@ class Test extends Command */ public function handle() { - $torrentRep = new TorrentRepository(); - $r = $torrentRep->getTrackerReportAuthKey(1, 1, true); -// $r = $torrentRep->resetTrackerReportAuthKeySecret(1); -// dd($r); - dd($r, $torrentRep->checkTrackerReportAuthKey($r)); +// $r = \Illuminate\Support\Facades\Schema::getColumnListing('torrents'); + $r = urldecode('bm9wZQ%3D%3D'); + $r = base64_decode($r); + dd($r); } } diff --git a/nexus/Database/DB.php b/nexus/Database/DB.php index 7a404e10..8261b76f 100644 --- a/nexus/Database/DB.php +++ b/nexus/Database/DB.php @@ -228,4 +228,10 @@ class DB return Capsule::schema(self::ELOQUENT_CONNECTION_NAME); } + public static function table($table): \Illuminate\Database\Query\Builder + { + return Capsule::table($table); + } + + } diff --git a/public/download.php b/public/download.php index 5bb24cda..285023e7 100644 --- a/public/download.php +++ b/public/download.php @@ -64,7 +64,7 @@ if (@ini_get('output_handler') == 'ob_gzhandler' AND @ob_get_length() !== false) header('Content-Encoding:'); } */ -if (isset($_COOKIE["c_secure_tracker_ssl"]) && $_COOKIE["c_secure_tracker_ssl"] == base64("yeah")) +if ((isset($_COOKIE["c_secure_tracker_ssl"]) && $_COOKIE["c_secure_tracker_ssl"] == base64("yeah")) || !empty($https_announce_urls)) $tracker_ssl = true; else $tracker_ssl = false;