Skip to content

Commit

Permalink
CSRF for file configuration URL
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jan 14, 2022
1 parent f59ffb0 commit 6ad1349
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lhc_web/design/defaulttheme/tpl/lhfile/configuration.tpl.php
Expand Up @@ -10,6 +10,8 @@

<form action="" ng-non-bindable method="post">

<?php include(erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php'));?>

<div class="row">
<div class="col-6">
<div class="form-group">
Expand Down
6 changes: 6 additions & 0 deletions lhc_web/modules/lhfile/configuration.php
Expand Up @@ -7,6 +7,12 @@


if (isset($_POST['StoreFileConfiguration'])) {

if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('file/configuration');
exit;
}

$definition = array(
'AllowedFileTypes' => new ezcInputFormDefinitionElement(
ezcInputFormDefinitionElement::OPTIONAL, 'string'
Expand Down

0 comments on commit 6ad1349

Please sign in to comment.