Skip to content

Commit

Permalink
fix(dropdownfield): add security token for GLPI 9.5.3
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 28, 2021
1 parent c5044cf commit d6adbbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ public function getRenderedHtml($canEdit = true): string {
if (!empty($this->question->fields['values'])) {
$dparams = $this->buildParams($rand);
$dparams['display'] = false;
if (version_compare(GLPI_VERSION, '9.5.3') >= 0) {
$params['_idor_token'] = Session::getNewIDORToken(User::getType());

This comment has been minimized.

Copy link
@stonebuzz

stonebuzz Feb 3, 2021

Contributor

@btry dropdownfield is not only User type
this part should be improved ?

$idorType = $itemtype::getType();
$params['_idor_token'] = Session::getNewIDORToken($idorType);

This comment has been minimized.

Copy link
@btry

btry Feb 3, 2021

Author Collaborator

You're right

}
$html .= $itemtype::dropdown($dparams);
}
$html .= PHP_EOL;
Expand Down

0 comments on commit d6adbbf

Please sign in to comment.