You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BiliRoaming-PHP-Server/utils/process.php

49 lines
1.2 KiB
PHTML

<?php
// 防止外部破解
if(!defined('SYSTEM')) {exit(BLOCK_RETURN);}
3 years ago
// 判断要转发的内容
$path = explode('/index.php', $_SERVER['PHP_SELF'])[0];
$query = str_replace("/&", "", $_SERVER['QUERY_STRING']);
define('ACCESS_KEY', @$_GET['access_key']);
define('CID', @$_GET['cid']);
define('EP_ID', @$_GET['ep_id']);
define('SS_ID', @$_GET['season_id']);
define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']);
3 years ago
$baned = 0;
if (BILIROAMING_VERSION == '') {
if (BILIROAMING == 1 && WEB_ON == 0) { //仅限漫游用户且未开放web脚本
3 years ago
$baned = 1;
}
if (@$_GET['area'] == '' || @$_GET['area'] == 'false') { //web脚本
define('AREA', 'noarea');
} else {
define('AREA', @$_GET['area']);
}
} else if (@$_GET['area'] == '') { //适配老漫游版本
define('AREA', 'oldversion');
} else {
define('AREA', @$_GET['area']);
}
if (@$_GET['ts'] == '') {
define('TS', time());
}else{
define('TS', @$_GET['ts']);
}
if (in_array(EP_ID, $epid_list) && BAN_EP == 1) {
$baned = 1;
}
if (in_array(CID, $cid_list) && BAN_CID == 1) {
$baned = 1;
}
if (in_array(AREA, $BAN_SERVER_AREA)) {
$baned = 1;
3 years ago
block();
}
3 years ago
function block(){
http_response_code(404);
exit(BLOCK_RETURN);
}
?>