From bcb789a950b4a5faa300f381566b63a4fff55ce1 Mon Sep 17 00:00:00 2001 From: tdh <821028463@qq.com> Date: Wed, 9 Apr 2025 01:57:10 +0800 Subject: [PATCH] fix announce.php , use $GLOBALS array in the loop for accessing values instead of direct variable references. --- public/announce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/announce.php b/public/announce.php index 8f223a04..c3afac94 100644 --- a/public/announce.php +++ b/public/announce.php @@ -19,7 +19,7 @@ foreach (array("port","downloaded","uploaded","left","compact","no_peer_id") as } //check info_hash, peer_id and passkey foreach (array("info_hash","peer_id","port","downloaded","uploaded","left") as $x) - if (!isset($x)) warn("Missing key: $x"); + if (!isset($GLOBALS[$x])) warn("Missing key: $x"); foreach (array("info_hash","peer_id") as $x) if (strlen($GLOBALS[$x]) != 20) warn("Invalid $x (" . strlen($GLOBALS[$x]) . " - " . rawurlencode($GLOBALS[$x]) . ")"); if (isset($passkey) && strlen($passkey) != 32) warn("Invalid passkey (" . strlen($passkey) . " - $passkey)");