mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
Tracker URl
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.5');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-06-19');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-06-20');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -672,6 +672,7 @@ function command_exists($command): bool
|
||||
|
||||
function get_tracker_schema_and_host($combine = false): array|string
|
||||
{
|
||||
/*
|
||||
global $https_announce_urls, $announce_urls;
|
||||
$httpsAnnounceUrls = array_filter($https_announce_urls);
|
||||
$log = "cookie: " . json_encode($_COOKIE) . ", https_announce_urls: " . json_encode($httpsAnnounceUrls);
|
||||
@@ -704,6 +705,16 @@ function get_tracker_schema_and_host($combine = false): array|string
|
||||
if ($combine) {
|
||||
return $ssl_torrent . $base_announce_url;
|
||||
}
|
||||
*/
|
||||
$url = \App\Models\TrackerUrl::getById(0);
|
||||
if (empty($url)) {
|
||||
return $combine ? "" : [];
|
||||
}
|
||||
$ssl_torrent = parse_url($url, PHP_URL_SCHEME) . "://" ;
|
||||
$base_announce_url = parse_url($url, PHP_URL_HOST);
|
||||
if ($combine) {
|
||||
return $ssl_torrent . $base_announce_url;
|
||||
}
|
||||
return compact('ssl_torrent', 'base_announce_url');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user