Merge pull request #264 from DesperadoJ/dev

Update subscribe URL for Surge & Surfboard
This commit is contained in:
tokumeikoi 2020-07-05 14:08:30 +08:00 committed by GitHub
commit b2c53804d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,16 +117,7 @@ class ClientController extends Controller
}
// Subscription link
$subsURL = 'http';
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'];
}
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
$config = str_replace('$subs_link', $subsURL, $config);
$config = str_replace('$proxies', $proxies, $config);
@ -170,16 +161,7 @@ class ClientController extends Controller
}
// Subscription link
$subsURL = 'http';
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'];
}
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
$config = str_replace('$subs_link', $subsURL, $config);
$config = str_replace('$proxies', $proxies, $config);