fix array

This commit is contained in:
xiaomlove
2021-01-06 01:31:21 +08:00
parent a968b5855c
commit 9bce2ac1a4
17 changed files with 101 additions and 101 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ foreach (array("passkey","info_hash","peer_id","event") as $x)
// get integer type port, downloaded, uploaded, left from client
foreach (array("port","downloaded","uploaded","left","compact","no_peer_id") as $x)
{
$GLOBALS[$x] = $_GET[$x] ?? 0;
$GLOBALS[$x] = intval($_GET[$x] ?? 0);
}
//check info_hash, peer_id and passkey
foreach (array("passkey","info_hash","peer_id","port","downloaded","uploaded","left") as $x)
@@ -42,7 +42,7 @@ foreach(array("numwant", "num want", "num_want") as $k)
{
if (isset($_GET[$k]))
{
$rsize = $_GET[$k] ?? 0;
$rsize = intval($_GET[$k] ?? 0);
break;
}
}
@@ -57,7 +57,7 @@ if (!$az = $Cache->get_value('user_passkey_'.$passkey.'_content')){
$Cache->cache_value('user_passkey_'.$passkey.'_content', $az, 950);
}
if (!$az) err("Invalid passkey! Re-download the .torrent from $BASEURL");
$userid = $az['id'] ?? 0;
$userid = intval($az['id'] ?? 0);
//3. CHECK IF CLIENT IS ALLOWED
$clicheck_res = check_client($peer_id,$agent,$client_familyid);