Fix possible bug in Discord bridge

This commit is contained in:
HotPizzaYT 2022-05-12 22:18:51 -05:00
commit 9e40211486

View file

@ -2,9 +2,9 @@
// If I didn't ignore dkey.global and dhook.global, things would be a disaster. That is why Discord keys and Discord webhooks will not be provided.
if(isset($_POST["msg"]) && isset($_POST["usr"]) && isset($_POST["room"])){
if(file_exists("dkey.global") && file_exists("dhook.global")){
if(!(file_exists("dkey.global")) && !(file_exists("dhook.global"))){
echo "tunnel.setupfailure";
} else if($_POST["key"] == file_get_contents("dkey.global")){
} else if($_POST["key"] == file_get_contents("dkey.global") && file_exists("dhook.global")){
if(file_exists("data/".$_POST["room"].".json")){
// Room exists
// Set needed variables
@ -19,7 +19,7 @@ if(isset($_POST["msg"]) && isset($_POST["usr"]) && isset($_POST["room"])){
$jsonString = json_encode($jsonD);
file_put_contents("data/".$_POST["room"].".json",$jsonString);
} else {
echo "tunnel.roomnotexist";
echo "tunnel.roomnotexistorhooknotexist";
}
} else {
echo "tunnel.security.invalidkey";