mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-05 01:47:16 +00:00
fix: prevent reuse of old attacks by re-POSTing same values
This commit is contained in:
@@ -5371,6 +5371,13 @@ References: User ID/Message ID, Mode
|
|||||||
return mysqli_insert_id($this->dblink);
|
return mysqli_insert_id($this->dblink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function remA2b($id) {
|
||||||
|
$id = (int) $id;
|
||||||
|
|
||||||
|
$q = "DELETE FROM " . TB_PREFIX . "a2b WHERE id = $id";
|
||||||
|
return mysqli_query($this->dblink,$q);
|
||||||
|
}
|
||||||
|
|
||||||
// no need to cache this method
|
// no need to cache this method
|
||||||
function getA2b($ckey, $check) {
|
function getA2b($ckey, $check) {
|
||||||
list($ckey, $check) = $this->escape_input($ckey, $check);
|
list($ckey, $check) = $this->escape_input($ckey, $check);
|
||||||
|
|||||||
@@ -552,6 +552,10 @@ class Units {
|
|||||||
header( "Location: a2b.php" );
|
header( "Location: a2b.php" );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prevent re-use of the same attack via re-POSTing the same data
|
||||||
|
$database->remA2b($data['id']);
|
||||||
|
|
||||||
header( "Location: build.php?id=39" );
|
header( "Location: build.php?id=39" );
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,9 @@
|
|||||||
|
|
||||||
$database->modifyUnit($getFLData['wref'], $uname2, $amounts, $modes);
|
$database->modifyUnit($getFLData['wref'], $uname2, $amounts, $modes);
|
||||||
$database->addMovement(3,$getFLData['wref'],$data['to_vid'],$reference,time(),($time+time()));
|
$database->addMovement(3,$getFLData['wref'],$data['to_vid'],$reference,time(),($time+time()));
|
||||||
|
|
||||||
|
// prevent re-use of the same attack via re-POSTing the same data
|
||||||
|
$database->remA2b($data['id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user