mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 14:11:35 +00:00
add csrf protection
This commit is contained in:
parent
c5694c21b4
commit
0638dab4f8
|
@ -28,6 +28,11 @@ include("../inc/inc.DBInit.php");
|
||||||
include("../inc/inc.ClassUI.php");
|
include("../inc/inc.ClassUI.php");
|
||||||
include("../inc/inc.Authentication.php");
|
include("../inc/inc.Authentication.php");
|
||||||
|
|
||||||
|
/* Check if the form data comes from a trusted request */
|
||||||
|
if(!checkFormKey('overridecontentstatus')) {
|
||||||
|
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
|
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,7 @@ $(document).ready(function() {
|
||||||
// Display the Review form.
|
// Display the Review form.
|
||||||
?>
|
?>
|
||||||
<form class="form-horizontal" method="post" action="../op/op.OverrideContentStatus.php" id="form1" name="form1">
|
<form class="form-horizontal" method="post" action="../op/op.OverrideContentStatus.php" id="form1" name="form1">
|
||||||
|
<?php echo createHiddenFieldWithKey('overridecontentstatus'); ?>
|
||||||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
||||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue
Block a user