Fix possible bug in Discord bridge
This commit is contained in:
parent
645bca2c6d
commit
9e40211486
1 changed files with 3 additions and 3 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue