mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
Update subscribe URL for Surge & Surfboard
This commit is contained in:
parent
ac13d1a8e1
commit
0c7d27e331
@ -94,16 +94,7 @@ class ClientController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Subscription link
|
// Subscription link
|
||||||
$subsURL = 'http';
|
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
||||||
if (isset( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) == 'on') {
|
|
||||||
$subsURL .= 's';
|
|
||||||
}
|
|
||||||
$subsURL .= '://';
|
|
||||||
if ($_SERVER['SERVER_PORT'] != ('80' || '443')) {
|
|
||||||
$subsURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
|
|
||||||
} else {
|
|
||||||
$subsURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = str_replace('$subs_link', $subsURL, $config);
|
$config = str_replace('$subs_link', $subsURL, $config);
|
||||||
$config = str_replace('$proxies', $proxies, $config);
|
$config = str_replace('$proxies', $proxies, $config);
|
||||||
@ -147,16 +138,7 @@ class ClientController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Subscription link
|
// Subscription link
|
||||||
$subsURL = 'http';
|
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
||||||
if (isset( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) == 'on') {
|
|
||||||
$subsURL .= 's';
|
|
||||||
}
|
|
||||||
$subsURL .= '://';
|
|
||||||
if ($_SERVER['SERVER_PORT'] != ('80' || '443')) {
|
|
||||||
$subsURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
|
|
||||||
} else {
|
|
||||||
$subsURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = str_replace('$subs_link', $subsURL, $config);
|
$config = str_replace('$subs_link', $subsURL, $config);
|
||||||
$config = str_replace('$proxies', $proxies, $config);
|
$config = str_replace('$proxies', $proxies, $config);
|
||||||
|
Loading…
Reference in New Issue
Block a user