fix compatibility with php8

This commit is contained in:
xiaomlove
2020-12-29 03:02:34 +08:00
parent 32d47b66c9
commit fe7489ef51
33 changed files with 249 additions and 212 deletions
+2 -2
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] = 0 + $_GET[$x];
$GLOBALS[$x] = $_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 = 0 + $_GET[$k];
$rsize = $_GET[$k] ?? 0;
break;
}
}